[PR #788] [MERGED] fix(app-router): use override semantics when merging middleware headers into HTML responses #847

Closed
opened 2026-05-06 13:10:26 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/788
Author: @NathanDrake2406
Created: 4/8/2026
Status: Merged
Merged: 4/8/2026
Merged by: @james-elicx

Base: mainHead: fix/bug3-html-header-merge


📝 Commits (1)

  • 13336de fix(app-router): use override semantics when merging middleware headers into HTML responses

📊 Changes

2 files changed (+6 additions, -7 deletions)

View changed files

📝 packages/vinext/src/server/app-page-response.ts (+1 -5)
📝 tests/app-page-response.test.ts (+5 -2)

📄 Description

Summary

  • reuse mergeMiddlewareResponseHeaders in buildAppPageHtmlResponse so HTML responses follow the same middleware merge semantics as RSC responses
  • append only additive headers (Set-Cookie, Vary) and override singular headers (for example Cache-Control)
  • extend HTML response helper test coverage to assert middleware Cache-Control override with Set-Cookie/Vary accumulation

Verification

  • vp test run tests/app-page-response.test.ts
  • vp test run tests/app-route-handler-response.test.ts

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/788 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/8/2026 **Status:** ✅ Merged **Merged:** 4/8/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/bug3-html-header-merge` --- ### 📝 Commits (1) - [`13336de`](https://github.com/cloudflare/vinext/commit/13336dea8f991a02b0d6b2f36e5ea7944d267abf) fix(app-router): use override semantics when merging middleware headers into HTML responses ### 📊 Changes **2 files changed** (+6 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/app-page-response.ts` (+1 -5) 📝 `tests/app-page-response.test.ts` (+5 -2) </details> ### 📄 Description ## Summary - reuse `mergeMiddlewareResponseHeaders` in `buildAppPageHtmlResponse` so HTML responses follow the same middleware merge semantics as RSC responses - append only additive headers (`Set-Cookie`, `Vary`) and override singular headers (for example `Cache-Control`) - extend HTML response helper test coverage to assert middleware `Cache-Control` override with `Set-Cookie`/`Vary` accumulation ## Verification - `vp test run tests/app-page-response.test.ts` - `vp test run tests/app-route-handler-response.test.ts` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:26 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#847
No description provided.