fix: Local Server should pass HTTP headers down to the Lambda Runtime#643
fix: Local Server should pass HTTP headers down to the Lambda Runtime#643manojmahapatra wants to merge 3 commits intoawslabs:mainfrom
Conversation
|
Thank you @manojmahapatra, this is a really good first contribution. I added a tiny suggestion in the code. May I suggest to also update the 1/ add an example that doesn't depend on the API Gateway. (the APIGateway case is already covered, users can list the forwarded headers in the payload) |
|
|
||
| logger.trace("/invoke received invocation, pushing it to the pool and wait for a lambda response") | ||
| self.invocationPool.push(LocalServerInvocation(requestId: requestId, request: body)) | ||
| let forwardedHeaders = head.headers |
There was a problem hiding this comment.
This variable is only used once. Maybe you can just use head.headers in the LocalServerInvocation initializer below
|
Hi @sebsto, thanks for taking a look. As suggested I've also added an example that does not depend on the API gateway, and updated relevant docs/README. Tested locally, working as expected. |
Issue #
#607
Description of changes
The local HTTP server was not forwarding user‑provided headers to the runtime’s response. It passes all headers through to the runtime. This it makes local behavior match the Lambda runtime API contract and allows developers to opt into metadata by sending the appropriate runtime headers.
New/existing dependencies impact assessment, if applicable
N/A
Conventional Commits
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.