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

Support Multiple Set-Cookie Headers #75

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Conversation

metaskills
Copy link
Member

API Gateway has supported multi-value parameters (https://aws.amazon.com/about-aws/whats-new/2018/10/amazon-api-gateway-adds-support-for-multi-parameters/) for some time. This includes response headers such as Set-Cookie for both REST API and HTTP API. Even ALB integrations support this:

This article (https://medium.com/@lancers/amazon-api-gateway-explaining-lambda-payload-version-2-0-in-http-api-24b0b4db5d36) does a really good job of breaking down the two AWS references docs.

The problem? Rack's HTTP spec (https://github.com/rack/rack/blob/master/SPEC.rdoc#the-headers-) for multiple values in a single Set-Cookie header is to join them with a \n new line character. We can not pass this as is to API Gateway or an ALB. Instead we pull the Set-Cookie header from the standard headers response and instead pass it via the proper interface of cookies or multiValueHeaders as needed.

@metaskills metaskills merged commit de0826a into master Mar 4, 2021
@delete-merged-branch delete-merged-branch bot deleted the MultipleCookies branch March 4, 2021 04:39
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.

None yet

1 participant