Skip to content
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

To avoid duplicate response headers, only populate MultiValueHeaders #73

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

jancona
Copy link
Contributor

@jancona jancona commented Aug 4, 2020

Issue #, if available:
None, but I can create one if necessary.

Description of changes:
We were seeing duplicated CORS headers in our app, which caused the browser to not allow the connection. The problem appears to be caused by code which puts the response headers in both Headers and MultiValueHeaders. According to the docs:

If you specify values for both headers and multiValueHeaders, API Gateway merges them into a single list. If the same key-value pair is specified in both, only the values from multiValueHeaders will appear in the merged list.

So this may be a Lambda bug. But I can't see any reason to populate both maps and this patch appears to fix the duplicate headers.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@krotscheck
Copy link

Created issue #75 for ya. I have no control over merging this though :(

@krotscheck
Copy link

@sapessi - Could we get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants