Skip to content

net/http: hexEscapeNonASCII() does not escape % character #72745

@KumanekoSakura

Description

@KumanekoSakura

Go version

go version go1.23.6 linux/amd64

Output of go env in your module/workspace:

omitted

What did you do?

I noticed that hexEscapeNonASCII() in net/http/http.go does not escape % character despite that function is using % as an escape character.
Since a pathname containing % character might be specified as a redirected path, I think that hexEscapeNonASCII() needs to also escape % character. But commit 6ca662c did not explain why we don't need to escape % character.

What did you see happen?

hexEscapeNonASCII() does not escape % character

What did you expect to see?

hexEscapeNonASCII() escapes % character

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