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

Handle multiple cookies with the same name in the same way API Gateway does. #1249

Merged
merged 1 commit into from Apr 13, 2022

Conversation

roberttaylor426
Copy link
Contributor

Description

This PR makes serverless-offline's handling of multiple cookies with the same name reflect that of API Gateway.

The existing implementation merges cookies with the same name into a single cookie with a comma separated value, i.e. given cookies foo=bar & foo=baz, APIGatewayProxyEventV2.cookies resolves to foo=bar,baz.

After the change, cookies with the same name are kept separate, i.e. given cookies foo=bar & foo=baz, APIGatewayProxyEventV2.cookies resolves to foo=bar,foo=baz (as API Gateway behaves).

Motivation and Context

The current implementation is not representative.

How Has This Been Tested?

I would be quite happy to add automated tests but I could find no existing precedent for testing code in this class. Please feel free to suggest an automated testing strategy if you would like me to employ one.

I tested my implementation manually using the Node terminal, and tested a build of serverless-offline locally.

@dherault dherault merged commit fa0de52 into dherault:master Apr 13, 2022
@dherault
Copy link
Owner

Thanks @roberttaylor426 !

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

2 participants