-
Notifications
You must be signed in to change notification settings - Fork 43
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
v1.1.0 doesn't de-dupe "/" in relative URLs #16
Comments
Be careful with this, not to break protocol relative urls! |
seems like a bug |
@nvartolomei That's why I specifically called out a potential solution being adding a way to switch between relative/absolute URL mode, otherwise this seems like a really rough problem to solve. |
What if instead when calling join it is checked that slashes are passed as separate arguments then remove them and leave leading double slashes only if are passed in a single argument :) This implementation may be interesting :) |
Also:
and
|
The "url-join" package behaves incorrect in the currently latest version. (See jfromaniello/url-join#16) Therefore it's replaced with "urljoin" which works as expected.
That's definitely works wrong... Any plans to fix this? @jfromaniello? I think that relative protocol should be supported only when it's passed explicitly. This urljoin('/', '/some') should return And this urljoin('//', '/some') should return Library shouldn't make any assumptions. |
Is this really fixed, why it is still buggy?
Is this project still under maintenance? |
We've switched to more reliable URI.js, but for frontend solutions it would be too big in current state... |
These cases are already handled in the latest version. |
It looks like the
/
deduping regex changed afterv0.0.1
which means that relative URLs now don't correctly dedupe leading repeat
/
.I can work around it in my own code but if this is only intended to support absolute URLs that may be worth calling out.
Alternatively an option (added via the system introduced in #14) to specify if the URL is intended to be relative and use the older regex may be worthwhile. Thoughts? I can send a PR if you'd like.
The text was updated successfully, but these errors were encountered: