Skip to content

Commit 931d865

Browse files
author
ChenLi
committed
Fix encoded # in path parameter causes route to be evaluated differently
1 parent 7372aff commit 931d865

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,4 @@
282282
- yuleicul
283283
- zeromask1337
284284
- zheng-chuang
285+
- dunnai

packages/router/history.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ function getUrlBasedHistory(
694694
// pre-encode them since they might be part of a matching splat param from
695695
// an ancestor route
696696
href = href.replace(/ $/, "%20");
697+
href = typeof to === "string" ? href.replace(/#/, "%23") : href
697698
invariant(
698699
base,
699700
`No window.location.(origin|href) available to create URL for href: ${href}`

0 commit comments

Comments
 (0)