-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement Rewrite Headers support during routing #3897
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case
I'm working on the test cases for Rewrite/Redirect/Headers now. |
Tests implemented for Rewrite/Redirect, but the Headers support just landed in Next side and I can't test it until we update our canary dep. |
I've manually confirmed this works once by duplicating vercel/next.js@185a892. |
Benchmark for e0f37ec
Click to view full benchmark
|
Merging over some test flake. |
kodiak could handle this now. It won't block on mac or windows CI anymore. |
# Features * vercel/turbo#3897 * vercel/turbo#3670 # Bug Fixes * vercel/turbo#3894 * vercel/turbo#3910 * vercel/turbo#3895 * vercel/turbo#3912 * vercel/turbo#3805 # Performance Improvements * vercel/turbo#3836
The final piece to supporting Rewrites is implementing support for overwriting response headers. These overwritten headers need to be collected until we resolve into a final
ContentSourceContent::Static
(which gets turned intoResolveSourceRequestResult
, thenGetFromSourceResult
) to be returned into the HTTP response.I chose to implement this as an external list from the headers already present in a
ContentSourceContent::Static
. It felt wrong tocontent.await?
just to overwrite the returned headers, and then repackage that as a newContentSourceContentVc
. Theseheader_overwrites
exist only as a byproduct of route resolution, and specifically the exact path of rewrites we go through to get there. They're not intrinsic to theContentSourceContent
itself.Fixes WEB-617
Fixes WEB-299