Skip to content

URL class should drop one slash in cases when AppedPath() would end up with two slashes #5130

@antkmsft

Description

@antkmsft

If you initialized URL with https://www.micosoft.com/ and then .AppendPath("/path/to/something"), you would end up with https://www.microsoft.com//path/to/something, which is a malformed URL and there is no legitimate reason you might want one.

(But if you stated with https://www.micosoft.com (without the slash at the end), and then appended "/path/to/something", the URL will be without the double-slash).

The code ends up cluttered with "if(startsWith('/')){ drop leading '/' }", codegen has this logic. It messes up the recordings. Better to fix this in one place.

See also #5112, #5126, #5124, #5129.

Another thing to consider if we want to additionally make the libcurl transport to behave like WinHTTP, and also fix the double slash there, but I am not going to log an additional work item for that, because I think most likely, fixing the Url class would be enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions