Skip to content

Comments

[pull] main from honojs:main#144

Merged
pull[bot] merged 3 commits intocode:mainfrom
honojs:main
Feb 8, 2026
Merged

[pull] main from honojs:main#144
pull[bot] merged 3 commits intocode:mainfrom
honojs:main

Conversation

@pull
Copy link

@pull pull bot commented Feb 8, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

sano-suguru and others added 3 commits February 8, 2026 21:50
* fix(url): ignore fragment identifiers in getPath()

In Service Worker contexts, URLs may contain fragment identifiers (#)
which should not be included in route matching. This change modifies
getPath() to strip fragment identifiers from the path, consistent with
how query strings are already handled.

Fixes #4440

* fix: handle fragment before query in percent-encoded paths

When a URL contains a fragment with query-like characters (e.g., #section?foo=bar),
the previous logic would incorrectly include the fragment in the path because it
checked for '?' first and only looked for '#' if '?' was not found.

This fix uses Math.min() to find whichever delimiter ('?' or '#') comes first,
correctly handling edge cases per RFC 3986 where '#' terminates the path regardless
of subsequent '?' characters in the fragment.

Added test case for this edge case.

* test(url): add test for encoded hash (%23) in path with fragment

Verify that percent-encoded hash (%23) is preserved while real fragment
identifiers are correctly stripped. decodeURI preserves reserved characters
per Web Standards.

* perf(url): reduce === -1 evaluations in getPath

Restructure ternary to avoid redundant separator === -1 check.
For /path?x=1, reduces evaluations from 3 to 2.

Co-authored-by: usualoma <usualoma@users.noreply.github.com>

* test(url): add coverage for percent encoding without query or fragment

Cover the undefined branch when both queryIndex and hashIndex are -1.

---------

Co-authored-by: sanosuguru <sa.50.00.no.riku@gmail.com>
Co-authored-by: usualoma <usualoma@users.noreply.github.com>
…g to `node.pP` (#4663)

* fix: determine if rendered or not by node.vC[0] instead of referring to node.pP

* refactor: assign undefined to "pP" instead of deleting it

Because that is slightly more likely to be optimized by the JIT

* refactor: use while loop instead of for loop for shorter code
@pull pull bot locked and limited conversation to collaborators Feb 8, 2026
@pull pull bot added the ⤵️ pull label Feb 8, 2026
@pull pull bot merged commit 69ad885 into code:main Feb 8, 2026
18 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants