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:
Diffstat (limited to 'app.go')
-rw-r--r--app.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/app.go b/app.go
index 351441d0..59912bb1 100644
--- a/app.go
+++ b/app.go
@@ -3,6 +3,7 @@ package main
import (
"crypto/tls"
"log"
+ "net"
"net/http"
"strconv"
"strings"
@@ -62,7 +63,11 @@ func (a *theApp) serveContent(ww http.ResponseWriter, r *http.Request, https boo
return
}
- domain := a.domain(r.Host)
+ host, _, err := net.SplitHostPort(r.Host)
+ if err != nil {
+ host = r.Host
+ }
+ domain := a.domain(host)
if domain == nil {
serve404(&w)
return