-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should URL constructors prepend ? when initializing query objects? #248
Comments
"A new URLSearchParams object" doesn't invoke the constructor (which performs the stripping of |
3 tasks
Thanks for the clarification, I missed out the |
TimothyGu
added a commit
to nodejs/node
that referenced
this issue
Feb 17, 2017
PR-URL: #11372 Fixes: #11093 Ref: whatwg/url#248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas
pushed a commit
to italoacasas/node
that referenced
this issue
Feb 25, 2017
PR-URL: nodejs#11372 Fixes: nodejs#11093 Ref: whatwg/url#248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This question comes from the Node.js implementation, refs: nodejs/node#11093
The
URL
constructor specifies:And the
URLSearchParams
constructor specifies:But referencing the getter spec of
url.search
:one can infer that the
query
of an url should not have the leading?
, this means:?
stripped tonew URLSearchParams
new URLSearchParams
would strip a leading?
again, in any, but the WPT tests expect??a=b&c=d
to be serialized as%3Fa=b&c=d
AFAICT the
URL
constructor should prepend a?
here, if we don't introduce a special way to notify theURLSearchParams
constructor not to strip the leading?
:Also the definition of
url.query
in4.1. URL representation
can be a little bit more explicit about the leading?
. I can put up a PR if this is confirmed.The text was updated successfully, but these errors were encountered: