Skip to content

Patch setHeader for direct route handlers#93101

Merged
ijjk merged 1 commit into
canaryfrom
ijjk/fix-direct-entry-header
Apr 21, 2026
Merged

Patch setHeader for direct route handlers#93101
ijjk merged 1 commit into
canaryfrom
ijjk/fix-direct-entry-header

Conversation

@ijjk

@ijjk ijjk commented Apr 21, 2026

Copy link
Copy Markdown
Member

Summary

  • apply the setHeader cookie-support patch to direct route module handlers in prepare()
  • make patchSetHeaderWithCookieSupport() idempotent so both entry paths can call it safely
  • add an adapter-like direct RSC regression test that fails without the patch

Closes: NEXT-4919

Testing

  • NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=start pnpm testheadless test/e2e/app-dir/cache-components/cache-components.test.ts -t "should ignore late setHeader calls for direct RSC handlers after headers are sent"

@ijjk ijjk marked this pull request as ready for review April 21, 2026 19:45
@ijjk ijjk requested a review from ztanner April 21, 2026 20:29
@ijjk ijjk merged commit 9e71bba into canary Apr 21, 2026
335 of 337 checks passed
@ijjk ijjk deleted the ijjk/fix-direct-entry-header branch April 21, 2026 21:34
ijjk added a commit that referenced this pull request Apr 21, 2026
## Summary
- apply the `setHeader` cookie-support patch to direct route module
handlers in `prepare()`
- make `patchSetHeaderWithCookieSupport()` idempotent so both entry
paths can call it safely
- add an adapter-like direct RSC regression test that fails without the
patch

Closes: NEXT-4919

## Testing
- `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=start pnpm testheadless
test/e2e/app-dir/cache-components/cache-components.test.ts -t "should
ignore late setHeader calls for direct RSC handlers after headers are
sent"`

<!-- NEXT_JS_LLM_PR -->
@github-actions github-actions Bot added the locked label May 6, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants