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

fix: fix aws api gateway v2 event source cookies handling #389

Merged
merged 3 commits into from
May 11, 2021

Conversation

colonist4
Copy link
Contributor

@colonist4 colonist4 commented Mar 15, 2021

Issue #, if available:
Issue #388

Description of changes:
Change AWS API Gateway v2 event source

  • Insert Array check logic of 'set-cookie' headers
  • Delete headers['set-cookie']

Checklist

  • Tests have been added and are passing -> where should i insert test logic for api gateway v2 event source ?
  • Documentation has been updated

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

Comment on lines 66 to 67
responseToApiGateway.cookies = headers['set-cookie']
responseToApiGateway.cookies = Array.isArray(headers['set-cookie']) ? headers['set-cookie'] : [headers['set-cookie']]
delete headers['set-cookie']
Copy link
Contributor

Choose a reason for hiding this comment

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

may be we can remove some repeated code

if(cookies = headers['set-cookie']) {
    responseToApiGateway.cookies = Array.isArray(cookies) ? cookies: [cookies]
    delete headers['set-cookie']
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your reviewing.
I refactored and push it.
Can you check it again? thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you, looks good to me

Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the failing tests

@brett-vendia brett-vendia merged commit 6e0868c into CodeGenieApp:mainline May 11, 2021
github-actions bot pushed a commit that referenced this pull request May 11, 2021
## [4.3.5](v4.3.4...v4.3.5) (2021-05-11)

### Bug Fixes

* fix aws api gateway v2 event source cookies handling ([#389](#389)) ([6e0868c](6e0868c))
@github-actions
Copy link

🎉 This PR is included in version 4.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

OneDev0411 added a commit to OneDev0411/serverless-express that referenced this pull request Mar 16, 2023
## [4.3.5](CodeGenieApp/serverless-express@v4.3.4...v4.3.5) (2021-05-11)

### Bug Fixes

* fix aws api gateway v2 event source cookies handling ([#389](CodeGenieApp/serverless-express#389)) ([6e0868c](CodeGenieApp/serverless-express@6e0868c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants