Behaviour of `Url::join` for Paths Starting with a Windows Drive Letter
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 406
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
The following code I think demonstrates a potentially inconsistent treatment of paths starting with windows drive letters. In particular it is sort of treated like an absolute path, in that it overrides any path in the base url, but it is also doesn't behave like an absolute path either.
let root = Url::parse("file:///").unwrap();
println!("{}", root.join("foo").unwrap()); // file:///foo
println!("{}", root.join("/foo").unwrap()); // file:///foo
println!("{}", root.join("c:/foo").unwrap()); // c:/foo
println!("{}", root.join("/c:/foo").unwrap()); // file:///c:/foo
let root = Url::parse("file:///fiz/buz/").unwrap();
println!("{}", root.join("foo").unwrap()); // file:///fiz/buz/foo
println!("{}", root.join("/foo").unwrap()); // file:///foo
println!("{}", root.join("c:/foo").unwrap()); // c:/foo
println!("{}", root.join("/c:/foo").unwrap()); // file:///c:/foo
Looking at the standard I think c:/foo should be being interpreted as a path-relative-scheme-less-URL string which doesn't indicate that it should be treated differently from any other relative path just because it starts with a drive letter. That being said I definitely could be missing something
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Url::join entry point and reproduce the examples using Windows drive-letter paths. Compare the results with the WHATWG URL writing and path-relative scheme-less URL rules linked in the issue; done means the behavior is consistent with the selected specification and covered by regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100