net/http/httputil: SingleHostReverseProxy escaped paths are decoded #35908
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
/a
)/b%2fc
What did you expect to see?
The forwarded request should be
/a/b%2fc
What did you see instead?
The forwarded request is
/a/b/c
Reason
This is because when joining URLs, the SingleHostReverseProxy joins just the url.Path elements (https://github.com/golang/go/blob/master/src/net/http/httputil/reverseproxy.go#L112). However, the URL also includes a
RawPath
which holds an encoding hint specifically to specify how to encode the path (874a605).To fix this, RawPath also needs to be joined if it is set for either request.
The text was updated successfully, but these errors were encountered: