Skip to content

Commit

Permalink
decode only once
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Aug 12, 2021
1 parent daa0aea commit 64087f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/kit/src/runtime/client/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ export class Router {
if (this.owns(url)) {
const path = url.pathname.slice(this.base.length) || '/';

const routes = this.routes.filter(([pattern]) => pattern.test(decodeURI(path)));
const decoded = decodeURI(path);
const routes = this.routes.filter(([pattern]) => pattern.test(decoded));

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

0 comments on commit 64087f8

Please sign in to comment.