-
-
Notifications
You must be signed in to change notification settings - Fork 997
Closed
Labels
enhancementNew feature or request.New feature or request.
Description
What version of Hono are you using?
4.9.9
What runtime/platform is your app running on? (with version if possible)
browser service worker (Chrome)
What steps can reproduce the bug?
1: Run Hono in a Service Worker context using fire() from hono/service-worker
2: Define routes
app.get('/users/', (c) => c.html(...))
app.get('/users/:id', (c) => c.html(...))3: User navigates to the page with a fragment:
GET /users/#user-list
GET /users/1#profile-section
What is the expected behavior?
/users/#user-listmatches/users/route/users/1#profile-sectionmatches/users/:idroute withid = "1"
What do you see instead?
/users/#user-listmatches/users/:idroute withid = "#user-list"/users/1#profile-sectionmatches/users/:idbut withid = "1#profile-section"
This occurs because Service Workers receive the full URL including fragments, unlike traditional web servers where browsers strip fragments before sending requests. Hono's route matcher treats # as a regular character.
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request.New feature or request.