You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'querystring.parse' works a inconsistent way with URLSearchParams(chrome) and python's urlparse.parse_qs #10454
The querystring module is not intended to be 100% compatible with what browsers are doing.
If you're actually parsing a url, have you tried using the experimental WHATWG URL object in recent versions of node (require('url').URL)?
It doesn't seem that the WHATWG implementation is exporting its URLSearchParams, so currently it's only used when parsing a valid url. Perhaps that might be worth exporting though. /cc @jasnell
Activity
mscdex commentedon Dec 26, 2016
The
querystringmodule is not intended to be 100% compatible with what browsers are doing.If you're actually parsing a url, have you tried using the experimental WHATWG URL object in recent versions of node (
require('url').URL)?It doesn't seem that the WHATWG implementation is exporting its
URLSearchParams, so currently it's only used when parsing a valid url. Perhaps that might be worth exporting though. /cc @jasnellTimothyGu commentedon Jan 21, 2017
Currently even
URLSearchParamsis backed byquerystring.parse. Tracking issue is at #10821./cc @nodejs/url
watilde commentedon Jan 23, 2017
Like @TimothyGu said, we need to update the
querystring.parseto fix them because of:node/lib/internal/url.js
Lines 614 to 618 in 6b6123c
I opened a PR for it on #10967 😃
4 remaining items
querystring, url: repeated sep in a paramsString should be adjusted
querystring, url: repeated sep in a paramsString should be adjusted
TimothyGu commentedon Feb 4, 2017
Unfortunately, some cases still do not work as expected even after @watilde's fix:
querystring, url: handle repeated sep in search
querystring, url: handle repeated sep in search
querystring: fix empty pairs and optimize parse()