Closed gita-vahdatinia closed 2 years ago
It is intentional. The hostname cannot be empty if the protocol is special.
But why does that add a "@"? Shouldn't it throw an error and say it cant set the hostname to empty if there is a special protocol?
See https://www.huntr.dev/bounties/83a6bc9a-b542-4a38-82cd-d995a1481155/. url-parse
does not throw errors by design.
Okay thank you!
Hi! 👋
After the change from https://github.com/unshiftio/url-parse/pull/226 I was getting an incorrect evaluation of URLs when using
toString()
.Example: If I
urlParseLibrary('/a/relative/path')
I would get:If I set the hostname to
''
I would get the href as'https://@/a/relative/path',
Here is the diff that solved my problem:
Is this an intentional change? Please let me know Ill open PR