Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http/httputil: the default Director created by NewSingleHostReverseProxy can't pass through %2F #9589

Closed
minux opened this issue Jan 14, 2015 · 3 comments
Milestone

Comments

@minux
Copy link
Member

minux commented Jan 14, 2015

I know why this is the case and I know the (current) correct solution.

However, I think the default Director should use req.RequestURI and
URL.Opaque as much as possible so that trivial use of NewSingleHostReverseProxy
don't need to write ones' own Director implementation.

Thoughts?

PS: I was hit this problem because I wrote a reverse proxy for my
Gerrit instance, and Gerrit uses %2F a lot.

@minux
Copy link
Member Author

minux commented Jan 15, 2015

@bradfitz what do you think?

@bradfitz
Copy link
Contributor

bradfitz commented Apr 6, 2015

I would accept a patch but I'm not entirely motivated to do this myself.

But keep in mind that I like keeping ReverseProxy and NewSingleHostReverseProxy readable (as much as possible) for pedagogical purposes. So if you fix this, I'd prefer if you went out of your way to special case the %2F path with extra comments and keep the old path (even if it's redundant) just so people can read and see what the obvious way is, and why the %2F way is the more ugly & hard-to-read case.

You want to do this, @minux?

@bradfitz bradfitz added this to the Go1.5Maybe milestone Apr 6, 2015
@rsc rsc removed the repo-main label Apr 14, 2015
@rsc
Copy link
Contributor

rsc commented Jul 15, 2015

I think my changes to url.URL to preserve %2F probably fixed this. There's no test case, so can't be sure. But pretty sure.

@rsc rsc closed this as completed Jul 15, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Aug 11, 2015
@golang golang locked and limited conversation to collaborators Aug 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants