Skip to content

fix: strip internal routing headers from dev server responses#149

Merged
southpolesteve merged 1 commit intomainfrom
public/fix-strip-internal-routing-headers
Feb 27, 2026
Merged

fix: strip internal routing headers from dev server responses#149
southpolesteve merged 1 commit intomainfrom
public/fix-strip-internal-routing-headers

Conversation

@southpolesteve
Copy link
Copy Markdown
Collaborator

Summary

  • Strips all x-middleware-* prefixed headers from responses in both the App Router and Pages Router dev servers
  • These are internal routing signals (x-middleware-next, x-middleware-rewrite, x-middleware-override-headers) that should not be visible to clients
  • The prod server already handled this correctly; this brings the dev servers into parity
  • Adds test verifying no x-middleware-* headers appear in client responses

Strip all x-middleware-* prefixed headers from responses in both the
App Router and Pages Router dev servers before sending to clients.
These headers are internal routing signals (x-middleware-next,
x-middleware-rewrite, x-middleware-override-headers, etc.) and should
not be visible to end users.

The prod server already stripped these correctly. This brings the dev
servers into parity.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/vinext@149

commit: 04f61b0

@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

@southpolesteve southpolesteve merged commit 65f78a4 into main Feb 27, 2026
24 checks passed
@southpolesteve southpolesteve deleted the public/fix-strip-internal-routing-headers branch February 27, 2026 02:05
southpolesteve added a commit that referenced this pull request Feb 27, 2026
Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: southpolesteve <southpolesteve@users.noreply.github.com>
Co-authored-by: Steve Faulkner <sfaulkner@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant