sklad: use Request.URL when self-redirecting

This commit is contained in:
Přemysl Eric Janouch 2019-04-22 11:43:37 +02:00
parent 04e66d7888
commit 301d035425
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 2 deletions

View File

@ -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.