diff --git a/pkg/server/ui.go b/pkg/server/ui.go index 18e4eb43d..e90d74089 100644 --- a/pkg/server/ui.go +++ b/pkg/server/ui.go @@ -408,12 +408,18 @@ func (ui *UIHandler) serveFileTree(rw http.ResponseWriter, req *http.Request) { } func (ui *UIHandler) serveNewUI(rw http.ResponseWriter, req *http.Request) { + base := req.Header.Get("X-PrefixHandler-PathBase") suffix := req.Header.Get("X-PrefixHandler-PathSuffix") if ui.closureHandler == nil { log.Printf("%v not served: handler is nil", suffix) http.NotFound(rw, req) return } + if suffix == "new" { + // Add a trailing slash. + http.Redirect(rw, req, base + "new/", http.StatusFound) + return + } suffix = path.Clean(suffix) m := closurePattern.FindStringSubmatch(suffix)