mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
Fix search params decoding
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user