Skip to content

Commit 9946ac7

Browse files
committed
add a precondition to sendingResponse state
1 parent 15c68cb commit 9946ac7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
598598
)
599599

600600
case .connected(let context, .sendingResponse):
601+
602+
precondition(!hasCustomHeaders, "Programming error: Custom headers should not be sent in this state")
603+
601604
try await self.sendResponseBodyPart(
602605
byteBuffer,
603606
sendHeadWithRequestID: nil,

0 commit comments

Comments
 (0)