Closed lucasvieirasilva closed 3 months ago
Latest commit: 4ae591e0bf7616855e385b6fd1427ee0faaed4e2
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
open-next | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 1, 2024 11:05am |
Thanks for the report and PR! Just 1 minor nit wrt the logging.
Thanks @khuezy I've replaced the console.log
to debug
.
@conico974 I've made all the changes you requested
This PR changes the CloudFront event mapper to remove blacklisted and read-only headers from the CloudFront response.
Reason
When a server action is called Next.js tries to set the Keep-alive header which it can't be provided in the CloudFront Lambda Edge.
That returns the following response
Status Code: 502
Response:
Solution
There's an AWS document that lists all the blacklisted and read-only headers
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-function-restrictions-all.html#function-restrictions-headers
Based on this doc, I've changed the event-mapper to remove those headers from the response.
References
392