Skip to content

Add ControlPlaneRequestEncoder #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code review.
  • Loading branch information
fabianfett committed Dec 11, 2021
commit 379ba887ff3df4805eb58508c0a56c080955b0b1
4 changes: 2 additions & 2 deletions Sources/AWSLambdaRuntimeCore/ControlPlaneRequestEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ struct ControlPlaneRequestEncoder: _EmittingChannelHandler {
self.byteBuffer.writeString(.userAgentHeader)
self.byteBuffer.writeContentLengthHeader(length: contentLength)
self.byteBuffer.writeString(.CRLF) // end of head
if contentLength > 0 {
if let payload = payload, contentLength > 0 {
context.write(self.wrapOutboundOut(self.byteBuffer), promise: nil)
context.write(self.wrapOutboundOut(payload!), promise: promise)
context.write(self.wrapOutboundOut(payload), promise: promise)
} else {
context.write(self.wrapOutboundOut(self.byteBuffer), promise: promise)
}
Expand Down