aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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