mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #808] [MERGED] fix: strip internal prerender auth header from external rewrites #859
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#859
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/808
Author: @southpolesteve
Created: 4/9/2026
Status: ✅ Merged
Merged: 4/9/2026
Merged by: @southpolesteve
Base:
main← Head:fix/strip-prerender-secret-from-external-rewrites📝 Commits (1)
eadec1dfix: strip internal prerender auth header from external rewrites📊 Changes
3 files changed (+8 additions, -0 deletions)
View changed files
📝
packages/vinext/src/config/config-matchers.ts(+4 -0)📝
tests/app-router.test.ts(+2 -0)📝
tests/shims.test.ts(+2 -0)📄 Description
Summary
The shared external rewrite proxy now strips
x-vinext-prerender-secretbefore forwarding requests upstream.Details
proxyExternalRequest()intentionally forwards most request headers to match external rewrite proxying behavior, while stripping hop-by-hop andx-middleware-*headers. During vinext's prerender pipeline, internal HTTP requests carryx-vinext-prerender-secretso hidden prerender endpoints can authenticate.That internal auth header should never be forwarded to external rewrite destinations.
This change adds a targeted strip in
proxyExternalRequest()and extends the existing external rewrite forwarding tests to verify:x-middleware-*headers are still strippedx-vinext-prerender-secretis also strippedTests
tests/shims.test.tsexternal rewrite proxy unit testtests/app-router.test.tsexternal rewrite integration test🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.