aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-24 17:06:49 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-24 17:06:49 +0100
commitd1eb1bc18ae3840cffe6023ed1939fe2ba7fd410 (patch)
tree94a1d50c2c755fdfb254eea17b6b09ead134a891 /route.go
parentfc3e9dff50f049b5bbb9ddf09609277833032c02 (diff)
Ensure slash at end of ServerName
Diffstat (limited to 'route.go')
-rw-r--r--route.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/route.go b/route.go
index dbc2bd5..1440546 100644
--- a/route.go
+++ b/route.go
@@ -6,6 +6,7 @@ import (
"net/http"
"net/http/httputil"
"net/url"
+ "strings"
)
// Route defines a set of routes including correspondent TLS certificates
@@ -44,7 +45,10 @@ func (r Route) Restore() error {
if err != nil {
return err
}
- mux.Handle(v.ServerName+"/", httputil.NewSingleHostReverseProxy(up))
+ if !strings.HasSuffix(v.ServerName, "/") {
+ v.ServerName += "/"
+ }
+ mux.Handle(v.ServerName, httputil.NewSingleHostReverseProxy(up))
}
server.Handler = mux
return nil