url.parse and url.format doesn't behave correctly with whitespaces
Bilal2453 opened this issue · 6 comments
I think this might be a difference in url.parse
rather than url.format
(the url gets run through url.parse
at the start of url.format
).
I think this might be a difference in
url.parse
rather thanurl.format
(the url gets run throughurl.parse
at the start ofurl.format
).
Not sure about this, cause
url.format{ href = 'www.google.com/Search?q= a a a', search = '?q= a a a', query = 'q= a a a', path = 'www.google.com/Search?q= a a a', pathname = 'www.google.com/Search' }
would result the same
Strange, I don't see where that would be happening in the node implementation:
https://github.com/nodejs/node/blob/e767ed0558a17b87e543b79d1f842821fbdb8e6b/lib/url.js#L575-L660
That only affects the auth
portion (the user:pass
of http://user:pass@blah.com
)
couldn't we just pass the pathname encoding part ?
as spaces in there are invalid anyways, and just implementing that cause nodejs do too doesn't make that much sense.
the queries are probably encoded at the querystring part tho.