diff options
Diffstat (limited to 'proxy.go')
-rw-r--r-- | proxy.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -19,7 +19,7 @@ type Endpoint struct { } -func addEndpoint(s *auth.Sessions, pages page.Pages, e config.Endpoint) { +func addEndpoint(conf config.Config, s *auth.Sessions, pages page.Pages, e config.Endpoint) { log.Infof("proxying endpoint %v to %v", e.Path, e.Address) origin, err := url.Parse(e.Address) if err != nil { @@ -31,12 +31,12 @@ func addEndpoint(s *auth.Sessions, pages page.Pages, e config.Endpoint) { Origin: origin, } - http.HandleFunc(e.Path, func(w http.ResponseWriter, r *http.Request) { + http.HandleFunc(conf.PathPrefix + e.Path, func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Location", e.Path + "/") w.WriteHeader(http.StatusPermanentRedirect) }) - http.HandleFunc(e.Path + "/", func(w http.ResponseWriter, r *http.Request) { + http.HandleFunc(conf.PathPrefix + e.Path + "/", func(w http.ResponseWriter, r *http.Request) { log.Infof("REQ: %v", r.URL.Path) proxy(w, r, s, pages, end) }) |