servo / servo/rust-url

Joining relative path onto a file:// url with a hostname is non spec compliant

Open
#504 8 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.