diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-08 15:02:14 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-08 15:02:14 +0300 |
commit | 5ae747b1c800d02a4535fb1be0fdfcbc3ea0001e (patch) | |
tree | dbb89a7dc59b76cfe224cc881360d17c6250ae3a /app.go | |
parent | 76b6d671858b44d026300752e4d37ea3d0a1e4bc (diff) |
Add support for the port component in the Host header
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -3,7 +3,6 @@ package main import ( "crypto/tls" "errors" - "net" "net/http" "sync" @@ -87,11 +86,7 @@ func (a *theApp) redirectToHTTPS(w http.ResponseWriter, r *http.Request, statusC } func (a *theApp) getHostAndDomain(r *http.Request) (string, *domain.Domain, error) { - host, _, err := net.SplitHostPort(r.Host) - if err != nil { - host = r.Host - } - + host := request.GetHostWithoutPort(r) domain, err := a.domain(host) return host, domain, err |