mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #125] [MERGED] fix(shims): add missing URL setters to NextURL #331
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#331
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/125
Author: @harrisrobin
Created: 2/26/2026
Status: ✅ Merged
Merged: 3/4/2026
Merged by: @southpolesteve
Base:
main← Head:fix/next-url-setters-v2📝 Commits (3)
c371f32fix(shims): add missing URL setters to NextURLe1294earevert build artifact to main (remove local machine paths)e88c2bdMerge remote-tracking branch 'origin/main' into fix/next-url-setters-v2📊 Changes
2 files changed (+74 additions, -3 deletions)
View changed files
📝
packages/vinext/src/shims/server.ts(+22 -3)📝
tests/shims.test.ts(+52 -0)📄 Description
Summary
NextURLonly had setters forpathname,search, andhash. The propertiesport,host,hostname,protocol,href,username, andpasswordwere getter-only, unlike the platformURLclass.Libraries like
next-intlrely on being able to mutate a clonednextUrl. Specifically,getAlternateLinksHeaderValuedoes:In Cloudflare Workers the
x-forwarded-hostheader is always present, so this code path is always triggered, producing:Fix
Add setter counterparts for all writable URL properties so
NextURLbehaves identically to the platformURLclass:href,protocol,username,password,host,hostname,port(setters were missing)pathname,search,hashalready had setters;originandsearchParamsare read-only onURLtoo — unchangedTest plan
nextUrl.clone()setter compatibility test specifically simulating next-intl's patternoxlint)tsgo --noEmit)/bonk
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
PLAYWRIGHT_PROJECTinAGENTS.md#485