Skip to content

Some Uri round-tripping through Parts fails unexpectantly #394

@Nokel81

Description

@Nokel81

This might be because I am not well versed in the HTTP URI standards but I would expect following two pieces of code to produce the same (or basically the same) Parts instances.

1:

let mut parts = Uri::from_static("localhost:8080").into_parts();
parts.scheme = Some(Scheme::HTTPS);

2:

let parts = Uri::from_static("https://localhost:8080").into_parts();

However, for 2, the path_and_query is set to effectively Some("/") where as in 1 it is set to None. Which means that putting them back into a Uri, the second one passes where as the first one fails.

I think that the first one should work.

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