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: NewSingleHostReverseProxy doesn't preserve query parameters #2853

Closed
gopherbot opened this issue Feb 2, 2012 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by RyanneDolan:

What steps will reproduce the problem?
1. use NewSingleHostReverseProxy to create reverse proxy server
2. send HTTP request with path?query
3. base/path is preserved, but not ?query

What is the expected output?

proxy'd request should include query parameters of original request

What do you see instead?

query params removed

Which revision are you using?  (hg identify)
1107a7d3cb07 weekly/weekly.2012-01-27

The weekly and tip show:

req.URL.Scheme = target.Scheme
req.URL.Host = target.Host
req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
req.URL.RawQuery = target.RawQuery

What is the last line there supposed to do?  Deleting it restores expected behavior.
@bradfitz
Copy link
Contributor

bradfitz commented Feb 3, 2012

Comment 1:

I think this used to work but got broken with the recent URL changes?
Will fix.

Labels changed: added priority-go1, removed priority-triage.

Owner changed to @bradfitz.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 2 by RyanneDolan:

Yeah, it used to work.  I think it was "fixed" incorrectly with the URL changes.  It
looks like a simple matter of deleting that last line above, since req.URL.RawQuery
should not change.

@bradfitz
Copy link
Contributor

bradfitz commented Feb 8, 2012

Comment 4:

http://golang.org/cl/5642056

Status changed to Started.

@bradfitz
Copy link
Contributor

bradfitz commented Feb 8, 2012

Comment 5:

This issue was closed by revision 518ee11.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

3 participants