From c4aee66c3297985907521f70e993a93a529add1c Mon Sep 17 00:00:00 2001 From: mrkishi Date: Wed, 24 Oct 2018 21:19:03 -0300 Subject: [PATCH] Fix search params decoding --- templates/src/client/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/src/client/app.ts b/templates/src/client/app.ts index 43b0764..ed46630 100644 --- a/templates/src/client/app.ts +++ b/templates/src/client/app.ts @@ -90,8 +90,8 @@ export function select_route(url: URL): Target { const query: Record = {}; 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 };