sst / open-next

Open source Next.js serverless adapter
https://open-next.js.org
MIT License
3.73k stars 112 forks source link

fix: try to match errors, fall back to just adding raw key / value pare #336

Closed JanStevens closed 6 months ago

JanStevens commented 7 months ago

Hi,

Current logic for matching headers does not 100% match how nextjs deals with it. For example when you have a Content-Security-Policy header which contains urls like https://google.com then the matching will fail resulting in an Internal Server Error.

This PR adds a small bandage so non matched headers are just returned as-is ensuring no Internal Server Error is triggered.

Ideally we have same logic as Nextjs

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: 3d0026a644d593227c8f1e4f8b90172e917f5a80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages | Name | Type | | ---------------- | ----- | | open-next | Patch | | app-pages-router | Patch | | app-router | Patch | | tests-unit | Patch |

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

vercel[bot] commented 7 months ago

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 Jan 5, 2024 3:30pm
JanStevens commented 7 months ago

@khuezy No I just had some basic security headers present which caused the parameter matching to trip up.

Link to the relevant discord discussion: https://discord.com/channels/983865673656705025/1186265613220446218