aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/server.go
diff options
context:
space:
mode:
authorGuilherme Goncalves <guilhermeaugustosg@gmail.com>2018-06-23 22:32:26 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-06-25 19:12:51 +0000
commit37f05cc6367e16865b8018948eed7ab2136d9d86 (patch)
tree6fdde07be209bba7c0773cad1a76843202726bb2 /src/net/http/server.go
parent444e7ddb276ff6e515fad846037c0ffcf1425076 (diff)
downloadgo-37f05cc6367e16865b8018948eed7ab2136d9d86.tar.xz
net/http: document and test behavior of ServeMux with ports
Beginning on Go 1.9, ServeMux has been dropping the port number from the Host header and in the path pattern. This commit explicitly mentions the change in behavior and adds a simple test case to ensure consistency. Fixes #23351. Change-Id: I0270c8bd96cda92c13ac6437cdf66c2807b3042d Reviewed-on: https://go-review.googlesource.com/120557 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net/http/server.go')
-rw-r--r--src/net/http/server.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index c244b372fc..edc19c3a4c 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -2137,9 +2137,9 @@ func RedirectHandler(url string, code int) Handler {
// "/codesearch" and "codesearch.google.com/" without also taking over
// requests for "http://www.google.com/".
//
-// ServeMux also takes care of sanitizing the URL request path,
-// redirecting any request containing . or .. elements or repeated slashes
-// to an equivalent, cleaner URL.
+// ServeMux also takes care of sanitizing the URL request path and the Host
+// header, stripping the port number and redirecting any request containing . or
+// .. elements or repeated slashes to an equivalent, cleaner URL.
type ServeMux struct {
mu sync.RWMutex
m map[string]muxEntry