Skip to content
Source
Sign inSign up
TanStack/router

fix: Backslash incorrectly decoded (#3962) #5534

ClosedDreierF(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5534/headopened

Showing 2 changed files with 9 additions and 6 deletions.

x
0 of 2 viewed, 2 left
1 addition and 6 deletionspackages/router-core/src/path.tsModified
View file
@@ -348,12 +348,7 @@
// Handle regular pathname segment
return {
type: SEGMENT_TYPE_PATHNAME,
- value: partToMatch.includes('%25')
- ? partToMatch
- .split('%25')
- .map((segment) => decodeURI(segment))
- .join('%25')
- : decodeURI(partToMatch),
+ value: partToMatch,
}),
8 additions and 0 deletionspackages/router-core/tests/path.test.tsModified
View file
@@ -816,6 +816,14 @@
{ type: SEGMENT_TYPE_WILDCARD, value: '$' },
+ {
+ name: 'should preserve backslashes in path parameters',