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
In version 1.5.3 you could build a url without specifying the colin in the protocol as follows:
` const URL = require("url-parse");
const myURL = new URL(""); myURL.set("protocol", "https", true); myURL.set("slashes", true, true); myURL.set("hostname", "myhostname", true); myURL.set("port", 443, true); myURL.set("pathname", "my/path", true); console.log(myURL.toString()); // https://myhostname:443/my/path
` This would print the url as: "https://myhostname:443/my/path"
if you do the same with v1.5.4 it does not print out the slashes, instead you get "https:myhostname:443/my/path".
Is this expected behaviour? Or do you now always have to specify the colon with the protocol?
The text was updated successfully, but these errors were encountered:
The problem is that
myURL.set("protocol", "https", true);
sets myURL.slashes to false and myURL.set("slashes", true, true); is a noop in [email protected].
myURL.slashes
false
myURL.set("slashes", true, true);
[email protected]
You can add the trailing colon and/or use a falsy third argument in myURL.set("protocol");
myURL.set("protocol");
myURL.set("protocol", "https:"); myURL.set("protocol", "https:", false); myURL.set("protocol", "https"); myURL.set("protocol", "https", false);
Sorry, something went wrong.
The proper way is to use the trailing colon so that the library correctly recognizes special protocols.
No branches or pull requests
In version 1.5.3 you could build a url without specifying the colin in the protocol as follows:
`
const URL = require("url-parse");
`
This would print the url as: "https://myhostname:443/my/path"
if you do the same with v1.5.4 it does not print out the slashes, instead you get "https:myhostname:443/my/path".
Is this expected behaviour? Or do you now always have to specify the colon with the protocol?
The text was updated successfully, but these errors were encountered: