diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-24 17:06:49 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-24 17:06:49 +0100 |
commit | d1eb1bc18ae3840cffe6023ed1939fe2ba7fd410 (patch) | |
tree | 94a1d50c2c755fdfb254eea17b6b09ead134a891 /route.go | |
parent | fc3e9dff50f049b5bbb9ddf09609277833032c02 (diff) |
Ensure slash at end of ServerName
Diffstat (limited to 'route.go')
-rw-r--r-- | route.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |