Skip to content

net/url: QueryEscape escapes its own escape characters #56503

@UndeadBaneGitHub

Description

@UndeadBaneGitHub

What version of Go are you using (go version)?

$ go version
go1.19.2

But really, affects 1.18 and other versions too

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

It's universal anywhere, since it's a bug in logic implementation of internal shouldEscape method

What did you do?

Playground link: https://go.dev/play/p/WXXx4EiSy_E

What did you expect to see?

Already escaped string should not be escaped again (example behavior: Javascript encodeURIComponent method and similar)

What did you see instead?

It gets escaped as many times as the method is called.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions