Skip to content

net/http/httputil: NewSingleHostReverseProxy doesn't preserve query parameters #2853

@gopherbot

Description

@gopherbot

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions