-
Notifications
You must be signed in to change notification settings - Fork 474
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
Calling absoluteTo on URIs that are already absolute causes error #355
Comments
hey there! unfortunately the example makes little sense - what are you trying to achieve? |
Since posting this I've actually discovered that this example from the docs:
No longer works and that it's due to this shortcut in the body of the absoluteTo() method:
Breaking when there's nothing but a protocol. Anyway, I discovered this while trying to use this library called CrawlKit on a project, here's the relevant function:
I believe they're trying to clean up the random URLs or domain names or what not that's passed to their library, so just returning the same URL would be good for my use case. |
As the hostname validation caused some kerfuffle I've decided to make this feature opt-in, thereby returning to the previous default behavior of v1.18.10. As of v1.19.0 you can activate hostname validation globally by setting I'm sorry for the confusion, inconvenience caused by the original change and the delayed rectification. |
Thanks for the update! |
To reproduce, install the library with npm and then create a file with the following lines:
Running
node test.js
gives me this error:TypeError: Hostname cannot be empty, if protocol is http
The text was updated successfully, but these errors were encountered: