Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fix search params decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkishi committed Oct 25, 2018
1 parent ffd56e2 commit c4aee66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/src/client/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export function select_route(url: URL): Target {
const query: Record<string, string | true> = {};
if (url.search.length > 0) {
url.search.slice(1).split('&').forEach(searchParam => {
const [, key, value] = /([^=]+)(?:=(.*))?/.exec(searchParam);
query[key] = decodeURIComponent((value || '').replace(/\+/g, ' '));
const [, key, value] = /([^=]*)(?:=(.*))?/.exec(searchParam);
query[decodeURIComponent(key)] = decodeURIComponent((value || '').replace(/\+/g, ' '));
});
}
return { url, path, page, match, query };
Expand Down

0 comments on commit c4aee66

Please sign in to comment.