-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Url.parse without protocol #7547
Comments
I'm afraid that what you are passing to the
See http://tools.ietf.org/html/rfc3986 for details. |
Yeah, indeed its not valid URL. I felt like it would be good to get a feedback that I am providing invalid input. Would it than make sense to raise an exception? |
Hm... perhaps... @tjfontaine ? |
We can certainly document slightly better how this works, but for instance the reason this doesn't work this way is because there are urls without slashes that should be accurately parsed in that way: From
There's not a good deterministic approach to know that if otherwise not specified we meant "parse me as host and port" and cover any potential new protocol that someone makes. |
Recently stumbled upon the unexpected behaviour on
url.parse
. Url without protocol:will result in the following:
Instead I would expect protocol being empty and host/hostname and port being initialised.
Running node v0.10.22.
The text was updated successfully, but these errors were encountered: