Setting <non-spec:/>.pathname = '/.//p'
Categories
(Core :: Networking, defect, P3)
Tracking
()
People
(Reporter: valentin, Assigned: sekim)
References
(Blocks 2 open bugs, )
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
This bug comes from rust-url not being able to handle this case.
Reporter | ||
Updated•10 months ago
|
STR:
let url = new URL("non-spec:/");
url.pathname = "/.//p"
url
Results in:
URL { href: "non-spec://p", ... , pathname: "//p", ... }
Expected (rust-url):
"href": "non-spec:/.//p",
"pathname": "//p"
Seems like the issue is due to https://github.com/servo/rust-url/blob/f447500049cbfe42203ff16026842e74f3fd99ac/url/src/parser.rs#L1384-1385, this is unable to recognize cases where "//"
occurs across serialization
and pathname
fn test_nonspec() {
let u1 = url::Url::parse("non-spec:/").unwrap();
let url = Url::join(&u1, "/.//p").unwrap();
println!("{}", url);
...
}
>> non-spec:/.//p
The current test that I implemented is incorrect; is there a way to assign url.pathname
for experimentation?
Did you try adding a test to the setters_tests.json?
It looks like that file gets pulled in here and sets the pathname here.
(In reply to Ed Guloien [:edgul] from comment #5)
Did you try adding a test to the setters_tests.json?
It looks like that file gets pulled in here and sets the pathname here.
The test already seems to exist, I just can't seem to log the issues via cargo test
or any of its variants.
Ah, by "log" I'm assuming you mean print to std::out. (Please correct me if I'm wrong)
I believe you are looking for cargo test -- --nocapture
Description
•