Skip to content

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

Open
@baivoom

Description

@baivoom
  • [ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions