-
Notifications
You must be signed in to change notification settings - Fork 3
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
How /..//bar
should be resolved aganst scheme:
?
#8
Comments
|
More simple examples:
Resulting strings will be |
./..//bar
should be resolved aganst scheme:foo1/foo2
?..//bar
should be resolved aganst scheme:foo1/foo2
?
..//bar
should be resolved aganst scheme:foo1/foo2
?/..//bar
should be resolved aganst scheme:
?
Reported python-hyper/rfc3986#84 and python-hyper/rfc3986#85. |
I'm going to make |
Already implemented and tests are added I'll refine docs and doc tests, and then will release. |
Maybe related: servo/servo#28386 use url;
use url::Url;
fn main() {
let base = Url::parse("foo:/bar").unwrap();
println!("base = {:?}", base);
let resolved = base.join("./..//baz").unwrap();
println!("resolved = {:?}", resolved);
assert_eq!(resolved.host(), None);
assert_eq!(resolved.path(), "//baz");
let resolved_s = resolved.to_string();
assert_eq!(resolved_s, "foo://baz");
let roundtrip = Url::parse(&resolved_s).unwrap();
println!("roundtrip = {:?}", roundtrip);
assert_eq!(resolved, roundtrip); // OK
assert_eq!(resolved.host(), roundtrip.host()); // Oops
} |
In the current implementation, resolving
./..//bar
againstscheme:foo1/foo2
results inscheme://bar
.However, this is not desired, since
bar
in//bar
should be a path segment butbar
inscheme://bar
is authority.How should this be treated? Can
resolve()
result in error?Details
merge("foo1/foo2", "./..//bar")
is"foo1/./..//bar"
.The text was updated successfully, but these errors were encountered: