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:
authorVlad Frolov <frolvlad@gmail.com>2017-05-10 15:42:45 +0300
committerVlad Frolov <frolvlad@gmail.com>2017-05-10 16:06:27 +0300
commitbd57f8b3a1dc5299dd699be44b2aade37b16409b (patch)
tree3861346d646349b760f2bda544743faab7d5b303 /app.go
parentdccd0f2b3206c2935b41ad1cedc02bd4922446b8 (diff)
Closes #51: Removed port from domain lookups
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