Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-08 15:02:14 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-08 15:02:14 +0300
commit5ae747b1c800d02a4535fb1be0fdfcbc3ea0001e (patch)
treedbb89a7dc59b76cfe224cc881360d17c6250ae3a /app.go
parent76b6d671858b44d026300752e4d37ea3d0a1e4bc (diff)
Add support for the port component in the Host header
Diffstat (limited to 'app.go')
-rw-r--r--app.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/app.go b/app.go
index 25a87785..9d275d29 100644
--- a/app.go
+++ b/app.go
@@ -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