diff options
author | Přemysl Janouch <p@janouch.name> | 2019-04-22 11:43:37 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2019-04-22 11:43:37 +0200 |
commit | 301d0354255ae1fc8255126ef5c35fd55cf97721 (patch) | |
tree | df0b46f85760b79612a0c52fc38fecfc68e69055 | |
parent | 04e66d7888f4567e004e4a6cf76765e8451c6a2d (diff) | |
download | sklad-301d0354255ae1fc8255126ef5c35fd55cf97721.tar.gz sklad-301d0354255ae1fc8255126ef5c35fd55cf97721.tar.xz sklad-301d0354255ae1fc8255126ef5c35fd55cf97721.zip |
sklad: use Request.URL when self-redirecting
-rw-r--r-- | cmd/sklad/main.go | 4 |
1 files 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. |