We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I've been working with the url extension and noticed it does not parse properly URL that do not contain protocol:
var url = require('url'); console.log(url.parse('//test.com/path?query=value'));
Is this a bug ?
The text was updated successfully, but these errors were encountered:
This is mostly a copy of the node.js url code. Do they have an open issue about this?
https://github.com/joyent/node
Sorry, something went wrong.
I ran into this issue myself, and the solution was right under my nose. Change your code to:
var url = require('url'); console.log(url.parse('//test.com/path?query=value', false, true));
This will parse the host and hostname correctly, but bear in mind the returned object.protocol will be null. More details in the node docs: https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
object.protocol
null
No branches or pull requests
Hi,
I've been working with the url extension and noticed it does not parse properly URL that do not contain protocol:
Is this a bug ?
The text was updated successfully, but these errors were encountered: