Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of Windows drive letter quirk #889

Open
1 task done
GabrielDertoni opened this issue Dec 11, 2023 · 0 comments
Open
1 task done

Incorrect parsing of Windows drive letter quirk #889

GabrielDertoni opened this issue Dec 11, 2023 · 0 comments

Comments

@GabrielDertoni
Copy link

  • 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.

GabrielDertoni added a commit to GabrielDertoni/rust-url that referenced this issue Dec 11, 2023
* Fixes the parser to correctly parse "file:///C|/hello/world" into "file:///C:/hello/world"
GabrielDertoni added a commit to GabrielDertoni/rust-url that referenced this issue Dec 12, 2023
* Fixes the parser to correctly parse "file:///C|/hello/world" into "file:///C:/hello/world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant