Skip to content

Keep a proxy rewrite status on RSC responses for stored redirects - #101705

Open
jamiboym wants to merge 2 commits into
adopt/101628from
claude/proxy-rewrite-rsc-redirect-status
Open

jamiboym wants to merge 2 commits into
adopt/101628from
claude/proxy-rewrite-rsc-redirect-status

Conversation

@jamiboym

@jamiboym jamiboym commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #101703, the adopted #101628 plus test cases for stored 404 and redirect statuses.

When Proxy rewrites with a status to a page that redirected at build time, next start answered the router's RSC request with 200. For RSC requests to a stored redirect, the runtime sets the status to 200 because the payload carries the redirect, and that also replaced the status Proxy had set. The client then followed the redirect without seeing the Proxy status.

The 200 now only replaces the redirect status that the runtime applied from the stored entry. With a Proxy status, the RSC response keeps it, the router falls back to a document load, and the page still redirects. Without one, the response is still 200 and the client redirects without a document load.

This matches Vercel, where the CDN applies a non-200 Proxy status to RSC responses too.

Verification

  • New tests click a <Link prefetch={false}> and record the status of the router's RSC request:
    • Through a rewrite with { status: 410 }: 410, and the browser still ends on the redirect target. Without this change it gets 200 in next start, with Cache Components off and on.
    • Without a rewrite: 200, as before.
  • pnpm test-start-turbo with Cache Components off and on, and pnpm test-dev-turbo: pass.
  • pnpm test-deploy against vtest314-next-e2e-tests: passes, so Vercel sends 410 for the rewritten request and 200 without the rewrite.

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Agent finished reviewing your changes.
d4874b8 • Tue, 17 Nov 2026 15:10:23 GMT

Vercel Agent's latest review does not approve this pull request under the repository's review policy.

Explanation

Human review requested from @unstubbable and @timneutkens: the merge-base policy strongly escalates response-status changes at packages/next/src/build/templates/app-page-runtime.ts:2322–2329. No blocking defects found; reviewed all changed files and reproduced the status correction using the extracted base and head logic, including PPR on and off. End-to-end verification remains unavailable because dependencies and framework build outputs are absent.

Review steps (1m 16s)

Preparing the workspace 16.3s
Analyzing the changes 56.7s
Finalizing the review 2.5s

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: d4874b8
View workflow run

@jamiboym
jamiboym added this pull request to stack #101706 November 13, 2026 00:55
@jamiboym
jamiboym removed this pull request from stack #101706 November 13, 2026 03:30
@jamiboym
jamiboym changed the base branch from claude/proxy-rewrite-status-tests to adopt/101628 November 13, 2026 03:31
@jamiboym
jamiboym added this pull request to stack #101715 November 13, 2026 03:31
@jamiboym
jamiboym removed this pull request from stack #101715 November 13, 2026 03:39
@jamiboym
jamiboym added this pull request to stack #101716 November 13, 2026 03:39
@jamiboym
jamiboym marked this pull request as ready for review November 16, 2026 21:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant