From 301d0354255ae1fc8255126ef5c35fd55cf97721 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Mon, 22 Apr 2019 11:43:37 +0200 Subject: sklad: use Request.URL when self-redirecting --- cmd/sklad/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/sklad/main.go b/cmd/sklad/main.go index 58aa8ef..52cbee5 100644 --- a/cmd/sklad/main.go +++ b/cmd/sklad/main.go @@ -116,7 +116,7 @@ func handleContainer(w http.ResponseWriter, r *http.Request) { var err error if r.Method == http.MethodPost { if err = handleContainerPost(r); err == nil { - redirect := "container" + redirect := r.URL.EscapedPath() if shownId != "" { redirect += "?id=" + url.QueryEscape(shownId) } @@ -198,7 +198,7 @@ func handleSeries(w http.ResponseWriter, r *http.Request) { var err error if r.Method == http.MethodPost { if err = handleSeriesPost(r); err == nil { - http.Redirect(w, r, "series", http.StatusSeeOther) + http.Redirect(w, r, r.URL.EscapedPath(), http.StatusSeeOther) return } // XXX: This is rather ugly. -- cgit v1.2.3-70-g09d2