summaryrefslogtreecommitdiff
path: root/proxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'proxy.go')
-rw-r--r--proxy.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/proxy.go b/proxy.go
index 7be9419..4442fb9 100644
--- a/proxy.go
+++ b/proxy.go
@@ -31,6 +31,11 @@ func addEndpoint(s *auth.Sessions, pages page.Pages, e config.Endpoint) {
Origin: origin,
}
+ http.HandleFunc(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) {
log.Infof("REQ: %v", r.URL.Path)
proxy(w, r, s, pages, end)