Skip to content

Commit 1f32f03

Browse files
committed
fix(matcher): should try catch decode only
1 parent 4b926e3 commit 1f32f03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/create-matcher.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,16 @@ function matchRoute (
175175
path: string,
176176
params: Object
177177
): boolean {
178-
let m
179178
try {
180-
m = decodeURI(path).match(regex)
179+
path = decodeURI(path)
181180
} catch (err) {
182181
if (process.env.NODE_ENV !== 'production') {
183182
warn(false, `Error decoding "${path}". Leaving it intact.`)
184183
}
185184
}
186185

186+
const m = path.match(regex)
187+
187188
if (!m) {
188189
return false
189190
} else if (!params) {

0 commit comments

Comments
 (0)