Skip to content

Incorrect parsing of Windows drive letter quirk #889

Open
@GabrielDertoni

Description

@GabrielDertoni
  • Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

Description
The following test case fails

let u = Url::parse("file:///C|/hello/world").unwrap();
assert_eq!(u.as_str(), "file:///C:/hello/world");

Playground link

According to the specification, it appears to me that this test case should pass. Currently the result given by the parser will be "file:///C|/hello/world" (without the '|' to ':' conversion). Looking at the implementation Parser::parse_file_host ignores the bool returned by Parser::file_host, which indicates the branch specified in file host state.1. This results in the error described.

Please let me know if this is indeed an issue with the implementation or if I've missed something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions