-
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
Should segment() take care of leading slash? #236
Comments
segment()
take care of leading slash?
is it possible you're looking for URI('font.ttf').absoluteTo('https://google.com/').toString()
// https://google.com/font.ttf
URI('/font.ttf').absoluteTo('https://google.com/').toString()
// https://google.com/font.ttf
URI('font.ttf').absoluteTo('https://google.com/somewhere/').toString()
// https://google.com/somewhere/font.ttf
URI('/font.ttf').absoluteTo('https://google.com/somewhere/').toString()
// https://google.com/font.ttf But to answer your question: the Removing leading and trailing slashes would be a convenience thing. Feel free to submit a PR for that :) |
@rodneyrehm if you think |
leading and trailing |
Perfect, I'll work on this over the weekend. Thanks! |
any progress on this, @orlando? |
@rodneyrehm actually I made the fix, but totally forgot about the PR. Thanks for the heads up, I'll make the PR between tonight and tomorrow. |
any progress on the PR, @orlando? |
@rodneyrehm PR up |
released in v1.17.0 |
I'm using URI.js to append a cdn host to URLs, the problem is that some assets have a leading slash and other don't.
Should
segment()
method take care of this?Example
Result of second example should be like the first one.
Thanks!
The text was updated successfully, but these errors were encountered: