Joining relative path onto a file:// url with a hostname is non spec compliant
Open
Nobody has claimed this yet.
spec unclear
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 406
- PR merge metrics
- No merged PRs in 30d
Description
use url::Url;
fn main() {
let u = Url::parse("file://server/some/dir/file")
.unwrap()
.join("/another/path/at/the/same/server")
.unwrap();
println!("{}", u);
}
Expected output: file://server/another/path/at/the/same/server
Actual output file:///another/path/at/the/same/server
Compare also the output from Firefox developer tools:
> new URL("/another/path/at/the/same/server", "file://server/some/dir/file")
URL {href: "file://server/another/path/at/the/same/server", origin: "file://", protocol: "file:", username: "", password: "", …}
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 shown in the reproduction and trace how file:// URLs with a hostname are handled. Compare the result with the expected URL and the Firefox behavior, then add a regression test covering the reported join and verify the test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100