diff --git a/src/net/http/cgi/host.go b/src/net/http/cgi/host.go index 073952a7bd..085658ee7a 100644 --- a/src/net/http/cgi/host.go +++ b/src/net/http/cgi/host.go @@ -132,6 +132,9 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { } port := "80" + if req.TLS != nil { + port = "443" + } if matches := trailingPort.FindStringSubmatch(req.Host); len(matches) != 0 { port = matches[1] }