Skip to content

Disabling "remove dot segments" behavior #874

Open
@jwodder

Description

@jwodder

I have a use-case where I need to be able to construct URLs that end in …/. or …/..1; however, the url crate insists on removing dot segments no matter what API I go through, even when the dots are percent-escaped, e.g.:

fn main() {
    let url = url::Url::parse("https://example.com/path/%2e%2e").unwrap();
    // Prints "https://example.com/":
    println!("{url}");
}

Is there currently a method to construct a URL like this using this crate? If not, could such a method be added?

Footnotes

  1. Specifically, this is for manipulating GitHub labels via the GitHub REST API; if a user names a label with dot or dot-dot, the URL ends up with dots at the end.

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