You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a reverse proxy pass and passing encoded URL path parameter. However, it seems that NewSingleHostReverseProxy doesn't set Raw URL and hence it double escapes the path?
What did you expect to see?
Pass path parameters as is when creating a reverse proxy, but reverse proxy double escapes them.
However, if the RawPath is set it shouldn't double encode but NewSingleHostReverseProxy isn't setting RawPath when creating Director
@arun0009 it would be helpful if you provided repro code. (Your Go code just prints out some URLs; it doesn't use httputil.NewSingleHostReverseProxy.)
From the description this sounds a lot like #35908 which was fixed in 2d323f9.
You filled out the issue template to say that this problem reproduces with the latest Go release. Are you sure you checked with Go 1.15?
cespare
changed the title
NewSingleHostReverseProxy doesn't set RawPath when creating Director
net/http/httputil: NewSingleHostReverseProxy doesn't set RawPath when creating Director
Aug 28, 2020
@cespare - I was using go 1.14.4 and updating to go 1.15 fixed the problem. I was just trying to show in my code sample that if you don't set RawPath with encoded value and unescaped Path value, your encoded path can get double escaped. I think in go 1.14.4 it wasn't setting RawPath and was fixed in the commit hash you posted above. Thanks!
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?
Creating a reverse proxy pass and passing encoded URL path parameter. However, it seems that NewSingleHostReverseProxy doesn't set Raw URL and hence it double escapes the path?
What did you expect to see?
Pass path parameters as is when creating a reverse proxy, but reverse proxy double escapes them.
However, if the RawPath is set it shouldn't double encode but NewSingleHostReverseProxy isn't setting RawPath when creating Director
e.g.
}
What did you see instead?
Playground link: https://play.golang.org/p/rOrVzW8ZJCQ
The text was updated successfully, but these errors were encountered: