diff --git a/cmd/monfront/main.go b/cmd/monfront/main.go index ac9de17..3f71727 100644 --- a/cmd/monfront/main.go +++ b/cmd/monfront/main.go @@ -154,10 +154,15 @@ func checkAction(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "could not parse parameters: %s", err) return } + ref, found := r.Header["Referer"] + if found { + w.Header()["Location"] = ref + } else { + w.Header()["Location"] = []string{"/"} + } checks := r.PostForm["checks"] action := r.PostForm["action"] if len(action) == 0 || action[0] == "" || len(checks) == 0 { - w.Header()["Location"] = []string{"/"} w.WriteHeader(http.StatusSeeOther) return } @@ -216,7 +221,6 @@ func checkAction(w http.ResponseWriter, r *http.Request) { log.Printf("could not adjust checks %#v: %s", checks, err) return } - w.Header()["Location"] = []string{"/"} w.WriteHeader(http.StatusSeeOther) return default: @@ -236,12 +240,6 @@ func checkAction(w http.ResponseWriter, r *http.Request) { log.Printf("could not adjust checks %#v: %s", checks, err) return } - ref, found := r.Header["Referer"] - if found { - w.Header()["Location"] = ref - } else { - w.Header()["Location"] = []string{"/"} - } w.WriteHeader(http.StatusSeeOther) return } @@ -639,35 +637,61 @@ var ( {{ if .Error }}
{{ .Error }}
{{ end }}`, "footer": ``, "checklist": `{{ template "header" . }}
@@ -693,7 +717,7 @@ var ( - + {{ $current := "" }} {{ $mapping := .Mappings }}
hoststatusnext checkmessage
hoststatusnext checkmessage