Skip to content

Commit 64087f8

Browse files
committed
decode only once
1 parent daa0aea commit 64087f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/kit/src/runtime/client/router.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ export class Router {
170170
if (this.owns(url)) {
171171
const path = url.pathname.slice(this.base.length) || '/';
172172

173-
const routes = this.routes.filter(([pattern]) => pattern.test(decodeURI(path)));
173+
const decoded = decodeURI(path);
174+
const routes = this.routes.filter(([pattern]) => pattern.test(decoded));
174175

175176
const query = new URLSearchParams(url.search);
176177
const id = `${path}?${query}`;

0 commit comments

Comments
 (0)