-
Notifications
You must be signed in to change notification settings - Fork 475
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
Extra slash added to url on version 1.19.2 #390
Comments
Perhaps line 686 was meant to be: if (parts.path.charAt(0) !== '/' && typeof parts.hostname === 'string' && requireAbsolutePath) |
you're seeing the result of #387 because your url var url = new URI("atlassian.com");
console.log(JSON.stringify(url._parts, null, 2)) outputs {
"protocol": null,
"username": null,
"password": null,
"hostname": null,
"urn": null,
"port": null,
"path": "atlassian.com",
"query": null,
"fragment": null,
"preventInvalidHostname": false,
"duplicateQueryParameters": false,
"escapeQuerySpace": true
} Maybe it's time to revisit #260 (and the unfinished attempt at providing a solution: #374) and provide a proper API for what you're trying to do… Are you looking to get your hands dirty with this? |
Given that we consistently have just a raw hostname (no proto/scheme/port), perhaps it’s best to start with a blank object, and fill in the parts, eh? Our library/app (atlassian-connect-express) has been using it the way I described for years, and with recent urijs updates, we started getting reports of the triple slash. I’ll take a look at #374 and see how dirty I’d like to get my hands. But for the short term, I believe we’ve got a fix. Thanks for your help today, and for your continued support on this library. |
4ced30a
The commit above (handle relative paths) on version 1.19.2 causes an extra slash to be added.
Output is:
https:///atlassian.com
The text was updated successfully, but these errors were encountered: