Skip to content

Fix Lambda Function URL responses. #872

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 1 commit into from
May 11, 2024
Merged
Changes from all commits
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
8 changes: 5 additions & 3 deletions lambda-http/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ impl LambdaResponse {
body,
status_code: status_code as i64,
is_base64_encoded,
// explicitly empty, as API gateway does not properly merge headers and
// multi-value-headers, resulting in duplicate headers
headers: HeaderMap::new(),
// ALB responses are used for ALB integrations as well as
// Lambda Function URLs. The former uses the `multi_value_headers` field,
// while the later uses the `headers` field. We need to return
// both fields to ensure both integrations work correctly.
headers: headers.clone(),
multi_value_headers: headers,
status_description: Some(format!(
"{} {}",
Expand Down
Loading