]> Cypherpunks repositories - gostls13.git/commitdiff
net/http/httputil: clarify NewSingleHostReverseProxy's Host header behavior
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Oct 2015 20:37:39 +0000 (13:37 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Oct 2015 23:15:40 +0000 (23:15 +0000)
Fixes #10342

Change-Id: I69c69352016a8fd0b62541128c2e86b242ebbe26
Reviewed-on: https://go-review.googlesource.com/15630
Reviewed-by: Minux Ma <minux@golang.org>
src/net/http/httputil/reverseproxy.go

index c8e113221c45dfa1fca62effc4189c7a3983450c..95a99ddb9dd0b19cbc24b4884fde36f78808348a 100644 (file)
@@ -60,10 +60,13 @@ func singleJoiningSlash(a, b string) string {
        return a + b
 }
 
-// NewSingleHostReverseProxy returns a new ReverseProxy that rewrites
+// NewSingleHostReverseProxy returns a new ReverseProxy that routes
 // URLs to the scheme, host, and base path provided in target. If the
 // target's path is "/base" and the incoming request was for "/dir",
 // the target request will be for /base/dir.
+// NewSingleHostReverseProxy does not rewrite the Host header.
+// To rewrite Host headers, use ReverseProxy directly with a custom
+// Director policy.
 func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy {
        targetQuery := target.RawQuery
        director := func(req *http.Request) {