Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/vinext/src/server/navigation-planner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ function classifyRscFetchResult(facts: RscFetchResultFacts): RscFetchResultDecis
}
if (redirectDecision.kind === "follow") {
return createRscFetchResultFollowRedirectDecision({
discardBody: false,
// The browser executor follows live response-URL redirects by fetching
// the target in a new loop iteration. The current response body is not
// read, so release it before the next fetch.
discardBody: facts.source === "live",
facts,
redirect: {
href: redirectDecision.href,
Expand Down
4 changes: 2 additions & 2 deletions tests/navigation-planner-rsc-fetch-result.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("navigationPlanner RSC fetch-result classification", () => {
});
});

it("follows response-URL redirects without discarding the body", () => {
it("follows live response-URL redirects and requires body discard", () => {
const decision = classify({
effectiveHistoryUpdateMode: "push",
redirectDepth: 2,
Expand All @@ -124,7 +124,7 @@ describe("navigationPlanner RSC fetch-result classification", () => {
});

expect(decision).toEqual({
discardBody: false,
discardBody: true,
kind: "followRedirect",
redirect: {
href: "/target?tab=1",
Expand Down
Loading