mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #150] [MERGED] fix: use decoded pathname for config matcher evaluation #350
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#350
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/150
Author: @southpolesteve
Created: 2/27/2026
Status: ✅ Merged
Merged: 2/27/2026
Merged by: @southpolesteve
Base:
main← Head:public/fix-decode-pathname-for-config-matchers📝 Commits (2)
e30f840fix: use decoded pathname for config matcher evaluation2473e44fix: handle malformed percent-encoding in config header path decode📊 Changes
5 files changed (+170 additions, -3 deletions)
View changed files
📝
packages/vinext/src/server/app-dev-server.ts(+2 -1)📝
packages/vinext/src/server/prod-server.ts(+6 -2)📝
tests/app-router.test.ts(+23 -0)📝
tests/pages-router.test.ts(+50 -0)📝
tests/shims.test.ts(+89 -0)📄 Description
Summary
next.config.js) now receive the decoded, normalized pathname so that percent-encoded request paths like/%61boutcorrectly match rules defined for/about.Details
Previously, the prod server's
urlvariable retained the raw (encoded) request URL, so config matchers compared encoded paths like/%61boutagainst rules expecting/about. This meant requests with percent-encoded characters would miss matching redirects, rewrites, and headers.The fix decodes and normalizes the pathname at entry, then reconstructs
urlfrom the decoded pathname + original query string. The App Router dev server also decodes the pathname before applying config headers.Error handling for malformed percent-encoding (e.g.
/%E0%A4%A) is preserved, returning 400 Bad Request.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.