mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #213] [MERGED] fix: make RequestContext required on matchHeaders/matchRedirect/matchRewrite #391
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#391
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/213
Author: @southpolesteve
Created: 3/1/2026
Status: ✅ Merged
Merged: 3/1/2026
Merged by: @southpolesteve
Base:
main← Head:fix/require-ctx-in-matchers📝 Commits (1)
888fcdefix: make RequestContext required on matchHeaders/matchRedirect/matchRewrite📊 Changes
4 files changed (+37 additions, -32 deletions)
View changed files
📝
packages/vinext/src/config/config-matchers.ts(+15 -16)📝
packages/vinext/src/deploy.ts(+1 -1)📝
packages/vinext/src/index.ts(+3 -3)📝
tests/shims.test.ts(+18 -12)📄 Description
Summary
ctx: RequestContexta required parameter onmatchHeaders,matchRedirect, andmatchRewriteinconfig-matchers.ts(and their wrapper functions inindex.ts)deploy.tswherematchHeaderswas called withoutreqCtx(the only call site missing it)RequestContextinstead of relying on the previously optional parameterWhy
Next.js always has request context when evaluating
has/missingconditions. There is no code path where these matchers run without a request. Makingctxrequired:matchHas()takesreqas a required parameterExtracted from #134 by @erayack.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.