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

Fix search params decoding #493

Merged
merged 1 commit into from
Oct 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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