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

The incorrect implementation of set_scheme for file:// #955

Open
baivoom opened this issue Aug 4, 2024 · 2 comments
Open

The incorrect implementation of set_scheme for file:// #955

baivoom opened this issue Aug 4, 2024 · 2 comments
Labels

Comments

@baivoom
Copy link

baivoom commented Aug 4, 2024

  • [ x] Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

Describe the bug

The scheme file will always have authority

image

but to set_scheme to file does not allow the file url to have the authority

image

Therefore the following test will fail in this case

#[test]
    fn test_url() {
        
        {
            let mut url = Url::parse("file:///path/to/file.js").unwrap();
            url.set_scheme("file").unwrap();
        }
    }

Not sure if it is a bug or a intentional design

@valenting valenting added the bug label Aug 5, 2024
@lwz23
Copy link

lwz23 commented Sep 15, 2024

It seems like a Rust Bug problem, I am interested in it and want try to solve this problem.

@valenting
Copy link
Collaborator

@lwz23 feel free to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants