fix(url): FastURL origin-form string + HTTP/2 char normalization - #227
Conversation
…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>
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
commit: |
Fixes two bugs in
src/_url.ts(FastURL) from the v1 stabilization review.new FastURL("/foo?x=1")(origin-form string, a documented fast path) stored a bare path, so#getPos()found no://and deopted tonew URL("/foo?x=1")with no base, throwingTypeError: Invalid URLon every getter. Now stores a fullhttp://localhosthref, matching the URLInit/deopt paths; getters work before and after deopt._searchNeedsNormREand_needsNormREnow trigger on controls, space, DEL, and all non-ASCII, so FastURL getters match nativeURLfor inputs like/p?q=éboth before and after deopt.Tests in
test/url.test.tsextended for both; full suite green, lint and typecheck clean.🤖 Generated with Claude Code