mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 06:08:46 -05:00
url: fix handling of ? in URLSearchParams creation
PR-URL: https://github.com/nodejs/node/pull/11372 Fixes: https://github.com/nodejs/node/issues/11093 Ref: https://github.com/whatwg/url/issues/248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
70afe9d3ac
commit
fa41dd117d
2 files changed
+14
-15
No files matched your search
+4
-5
@@ -95,12 +95,11 @@ function onParseComplete(flags, protocol, username, password,
|
||||
ctx.query = query;
|
||||
ctx.fragment = fragment;
|
||||
ctx.host = host;
|
||||
if (this[searchParams]) { // invoked from href setter
|
||||
initSearchParams(this[searchParams], query);
|
||||
} else {
|
||||
this[searchParams] = new URLSearchParams(query);
|
||||
if (!this[searchParams]) { // invoked from URL constructor
|
||||
this[searchParams] = new URLSearchParams();
|
||||
this[searchParams][context] = this;
|
||||
}
|
||||
this[searchParams][context] = this;
|
||||
initSearchParams(this[searchParams], query);
|
||||
}
|
||||
|
||||
// Reused by URL constructor and URL#href setter.
|
||||
|
||||
Reference in new issue
Block a user