[PR #48] [MERGED] fix(config): respect has/missing conditions in next.config headers #270

Closed
opened 2026-05-06 12:38:53 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/48
Author: @tomasgferreira
Created: 2/25/2026
Status: Merged
Merged: 2/28/2026
Merged by: @southpolesteve

Base: mainHead: fix/config-headers-has-missing


📝 Commits (3)

  • 6ea08f7 fix(config): respect has/missing conditions in next.config headers
  • f89d8df chore: add backward-compat comment for optional ctx in matchHeaders
  • 280237e fix: wire has/missing conditions through redirects and rewrites in Pages Router dev

📊 Changes

9 files changed (+208 additions, -58 deletions)

View changed files

📝 packages/vinext/src/config/config-matchers.ts (+11 -0)
📝 packages/vinext/src/config/next-config.ts (+2 -0)
📝 packages/vinext/src/index.ts (+51 -40)
📝 packages/vinext/src/server/app-dev-server.ts (+11 -6)
📝 packages/vinext/src/server/prod-server.ts (+1 -1)
📝 tests/app-router.test.ts (+1 -1)
📝 tests/e2e/app-router/config-redirect.spec.ts (+33 -10)
📝 tests/fixtures/app-basic/next.config.ts (+13 -0)
📝 tests/shims.test.ts (+85 -0)

📄 Description

Fixes next.config.headers() conditional matching by adding has/missing support in matchHeaders, wiring request context through dev/prod paths, updating NextHeader types, and enabling coverage with new unit + e2e tests for header/cookie/query conditions (including backward compatibility when no context is provided).


🔄 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/48 **Author:** [@tomasgferreira](https://github.com/tomasgferreira) **Created:** 2/25/2026 **Status:** ✅ Merged **Merged:** 2/28/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `fix/config-headers-has-missing` --- ### 📝 Commits (3) - [`6ea08f7`](https://github.com/cloudflare/vinext/commit/6ea08f733bfc3f987bf4ff602c2c621f8055de8e) fix(config): respect has/missing conditions in next.config headers - [`f89d8df`](https://github.com/cloudflare/vinext/commit/f89d8dff5a83d5a2b12c14ee654a12ad6606e7cf) chore: add backward-compat comment for optional ctx in matchHeaders - [`280237e`](https://github.com/cloudflare/vinext/commit/280237e3ccd64401cd780968eb9273e9c0e7f732) fix: wire has/missing conditions through redirects and rewrites in Pages Router dev ### 📊 Changes **9 files changed** (+208 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/config/config-matchers.ts` (+11 -0) 📝 `packages/vinext/src/config/next-config.ts` (+2 -0) 📝 `packages/vinext/src/index.ts` (+51 -40) 📝 `packages/vinext/src/server/app-dev-server.ts` (+11 -6) 📝 `packages/vinext/src/server/prod-server.ts` (+1 -1) 📝 `tests/app-router.test.ts` (+1 -1) 📝 `tests/e2e/app-router/config-redirect.spec.ts` (+33 -10) 📝 `tests/fixtures/app-basic/next.config.ts` (+13 -0) 📝 `tests/shims.test.ts` (+85 -0) </details> ### 📄 Description Fixes `next.config.headers()` conditional matching by adding `has/missing` support in `matchHeaders`, wiring request context through dev/prod paths, updating `NextHeader` types, and enabling coverage with new unit + e2e tests for header/cookie/query conditions (including backward compatibility when no context is provided). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:38:53 +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#270
No description provided.