summaryrefslogtreecommitdiff
path: root/cli/rt/11_url.js
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2020-09-02 03:34:41 +0900
committerGitHub <noreply@github.com>2020-09-01 20:34:41 +0200
commitb3563e85691f0a3da97ccc2c96d446730d4c65ac (patch)
tree4f118549976560f9df77cb6d28176a85fb68b693 /cli/rt/11_url.js
parentfee6f793302394f87ea2958088d14c44b66edae1 (diff)
fix(URLSearchParams): fix handling of + character (#7314)
Diffstat (limited to 'cli/rt/11_url.js')
-rw-r--r--cli/rt/11_url.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/rt/11_url.js b/cli/rt/11_url.js
index 5de6cc8c7..86dcbf26d 100644
--- a/cli/rt/11_url.js
+++ b/cli/rt/11_url.js
@@ -14,6 +14,10 @@
return sendSync("op_domain_to_ascii", { domain, beStrict });
}
+ function decodeSearchParam(p) {
+ return decodeURIComponent(p.replace(/\+/g, " "));
+ }
+
const urls = new WeakMap();
class URLSearchParams {
@@ -63,7 +67,7 @@
const position = pair.indexOf("=");
const name = pair.slice(0, position === -1 ? pair.length : position);
const value = pair.slice(name.length + 1);
- this.#append(decodeURIComponent(name), decodeURIComponent(value));
+ this.#append(decodeSearchParam(name), decodeSearchParam(value));
}
};