Skip to content

fix(url): FastURL origin-form string + HTTP/2 char normalization - #227

Merged
pi0 merged 1 commit into
mainfrom
fix/fasturl-origin-form
Jul 14, 2026
Merged

pi0 merged 1 commit into
mainfrom
fix/fasturl-origin-form

Conversation

@pi0x

@pi0x pi0x commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fixes two bugs in src/_url.ts (FastURL) from the v1 stabilization review.

  • F12new FastURL("/foo?x=1") (origin-form string, a documented fast path) stored a bare path, so #getPos() found no :// and deopted to new URL("/foo?x=1") with no base, throwing TypeError: Invalid URL on every getter. Now stores a full http://localhost href, matching the URLInit/deopt paths; getters work before and after deopt.
  • F33 — the normalization regexes assumed control chars and space are unreachable (true for HTTP/1, false over HTTP/2, which the Node adapter serves with the raw path verbatim). _searchNeedsNormRE and _needsNormRE now trigger on controls, space, DEL, and all non-ASCII, so FastURL getters match native URL for inputs like /p?q=é both before and after deopt.

Tests in test/url.test.ts extended for both; full suite green, lint and typecheck clean.

🤖 Generated with Claude Code

…tion

F12: `new FastURL("/foo?x=1")` stored a bare path, so `#getPos()` found no
`://` and deopted to `new URL("/foo?x=1")` with no base, throwing on every
getter. Store a full `http://localhost` href instead, matching the URLInit
and deopt paths.

F33: the normalization regexes assumed control chars and space are rejected
by the HTTP parser -- true for HTTP/1 but not HTTP/2, which the Node adapter
serves and delivers the raw path verbatim. `_searchNeedsNormRE` and
`_needsNormRE` now cover controls, space, DEL, and all non-ASCII, so FastURL
getters match native URL both before and after deopt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pi0x
pi0x requested a review from pi0 as a code owner July 14, 2026 11:22
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pi0x, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6c2bbb0b-2c1b-4484-b906-59b5a8c4168c

📥 Commits

Reviewing files that changed from the base of the PR and between f2edab1 and b34f763.

📒 Files selected for processing (2)
  • src/_url.ts
  • test/url.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fasturl-origin-form

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/srvx@227

commit: b34f763

@pi0
pi0 merged commit d8523dc into main Jul 14, 2026
15 checks passed
@pi0
pi0 deleted the fix/fasturl-origin-form branch July 14, 2026 12:15
@pi0x pi0x mentioned this pull request Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants