use url::Url;
fn main() {
let mut u = Url::parse("file:///").unwrap();
u.set_path("//foo");
println!("{}", u);
}
This should prints file:////foo instead of file:///foo.
Note: The below prints file:////foo in all major browsers
const a = new URL("file:///");
a.pathname = "//foo";
console.log(a.href);
This behavior affects the WPT cases below:
<file://monkey/> set pathname to <\\\\>
<file:///unicorn> set pathname to <//\\/>
<file:///unicorn> set pathname to <//monkey/..//>
This should prints
file:////fooinstead offile:///foo.Note: The below prints
file:////fooin all major browsersThis behavior affects the WPT cases below: