Skip to content

fix: Local Server should pass HTTP headers down to the Lambda Runtime#643

Merged
sebsto merged 7 commits intoawslabs:mainfrom
manojmahapatra:fix/local-server-forward-headers
Feb 18, 2026
Merged

fix: Local Server should pass HTTP headers down to the Lambda Runtime#643
sebsto merged 7 commits intoawslabs:mainfrom
manojmahapatra:fix/local-server-forward-headers

Conversation

@manojmahapatra
Copy link
Contributor

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.

@sebsto sebsto added the 🔨 semver/patch No public API change. label Feb 17, 2026
@sebsto sebsto self-assigned this Feb 17, 2026
@sebsto
Copy link
Collaborator

sebsto commented Feb 17, 2026

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 Examples/MultiTenant

1/ add an example that doesn't depend on the API Gateway.
2/ update the README file and add a section about Local testing?
We need to show user it's actually possible to make an invocation like this

(the APIGateway case is already covered, users can list the forwarded headers in the payload)

  # Test multi-tenant function locally
  curl -X POST http://127.0.0.1:7000/invoke \
    -H "Content-Type: application/json" \
    -H "Lambda-Runtime-Aws-Tenant-Id: tenant-123" \
    -d '{"message" :  "hello"}'

@manojmahapatra
Copy link
Contributor Author

manojmahapatra commented Feb 18, 2026

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.

@sebsto
Copy link
Collaborator

sebsto commented Feb 18, 2026

Looks good to me. I made a small change to pass the swift format check.

@sebsto sebsto self-requested a review February 18, 2026 14:13
Copy link
Collaborator

@sebsto sebsto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sebsto sebsto merged commit eccd045 into awslabs:main Feb 18, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments