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(aws-lambda,netlify-lambda): binary body v2 and cookies v1 #1683

Merged
merged 7 commits into from Sep 7, 2023

Conversation

Hebilicious
Copy link
Member

@Hebilicious Hebilicious commented Sep 1, 2023

πŸ”— Linked issue

Fix #852

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The aws-lambda preset works with apigw v1 and v2.
This PR fix the body type for apigw v2, and the cookies for apigw v1

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Hebilicious Hebilicious marked this pull request as draft September 1, 2023 14:45
@Hebilicious Hebilicious added bug Something isn't working wontfix This will not be worked on preset:aws-lambda and removed wontfix This will not be worked on labels Sep 1, 2023
@Hebilicious Hebilicious requested a review from pi0 September 1, 2023 14:45
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #1683 (a9a0c70) into main (0099df2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1683   +/-   ##
=======================================
  Coverage   77.79%   77.79%           
=======================================
  Files          76       76           
  Lines        7836     7836           
  Branches      805      805           
=======================================
  Hits         6096     6096           
  Misses       1738     1738           
  Partials        2        2           

src/runtime/utils.lambda.ts Outdated Show resolved Hide resolved
body: awsBody.body,
isBase64Encoded: awsBody.type === "binary",
...(cookies.length > 0 && {
multiValueHeaders: { "set-cookie": cookies },
Copy link
Member

Choose a reason for hiding this comment

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

Just checking, was this (another) fix or refactor to avoid empty object?

Copy link
Member Author

Choose a reason for hiding this comment

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

Refactor due to the initial fix, I made the modification here too so that both aws-lambda and netlify-lambda have consistent behaviour (Technically it improves the performances if its empty but not in a meaningful way...)

test/presets/aws-lambda.test.ts Outdated Show resolved Hide resolved
@pi0
Copy link
Member

pi0 commented Sep 1, 2023

@Hebilicious Since planning for next patch release, what is blocker for this PR? Do you need to verify it against a deployment?

@Hebilicious Hebilicious marked this pull request as ready for review September 1, 2023 19:23
@Hebilicious
Copy link
Member Author

@Hebilicious Since planning for next patch release, what is blocker for this PR? Do you need to verify it against a deployment?

Was just in draft because WIP, it should be good to go now πŸ‘πŸ½

@EnzoAlbornoz
Copy link

It would be great if this is merged. I'm having issues with hosting IPX on my lambda function.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks (i haven't test it through but i trust you did)

@pi0 pi0 changed the title fix(lambda): binary body v2 and cookies v1 fix(aws-lambda,netlify-lambda): binary body v2 and cookies v1 Sep 7, 2023
@pi0 pi0 merged commit 86d05f2 into main Sep 7, 2023
9 checks passed
@pi0 pi0 deleted the fix/lambda-binary-apigw-v1-v2-cookies branch September 7, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preset:aws-lambda
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS Serverless-Integration corrupts assets
3 participants