Skip to content

use EscapedPath instead of Path #8

@wansing

Description

@wansing

Way can't distinguish between / and %2F in a path. Thus %2F messes up the path segments.

I'd suggest to fix this by using u.EscapedPath() instead of req.URL.Path. Quoting net/url#URL:

Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the EscapedPath method, which preserves the original encoding of Path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions