-
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
absoluteTo() doesn't work with file:/// ? #328
Comments
The issue is not triggered by or limited to the If var rel = new URI("a://b/c?d#e");
rel.absoluteTo("v://w/x?y#z").toString();
// "a://b/c?d#e" if var rel = new URI("a:///c?d#e");
rel.absoluteTo("v://w/x?y#z").toString();
// "v://w/c?d#e" RFC 3986 - 5.2 Relative Resolution explains the algorithm to do this. However, it clearly states that if there is a scheme, the authority of the resolving URL should be used. URI.js on the other hand does a simple merge of all components. This behavior was introduced with a fix for #73 nearly 4 years ago. Given how long this behavior has been in place and you being the first one to stumble over it, I'm wondering if reverting to strict RFC 3986 compliance is the best course of action… |
Thank you for your explanation! I've also taken a look at #158 , and if I got this right, because the authority of some I've to say, this is really a rare case. At least in my situation, I hardly had a chance to process |
I've never seen that in the wild. It doesn't mean it doesn't exist, but I consider it much less likely than Do you want to create a patch for this? |
Oh, it's a pleasure! Give me a moment ;-) |
thank you! released as v1.18.8 |
As far as I know, I can make an absolute URL using the following routine
which results in
It works fine.
However, when I want to use
absoluteTo
withfile:///
protocol, like thisI get
instead of
Is this a bug, or have I got this wrong? Thank you!
The text was updated successfully, but these errors were encountered: