From 1e22b980abae96b40428a67f2dc4a12df1156a3d Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 16 Feb 2021 20:32:21 +0100 Subject: [bug] write headers before sending response - Closes: #436 --- pkg/helper/helper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/helper/helper.go b/pkg/helper/helper.go index 691fc6e..006d23b 100644 --- a/pkg/helper/helper.go +++ b/pkg/helper/helper.go @@ -148,17 +148,17 @@ func firewallStopHandler(w http.ResponseWriter, r *http.Request) { func firewallIsUpHandler(w http.ResponseWriter, r *http.Request) { if firewallIsUp() { - w.Write([]byte("true")) w.WriteHeader(http.StatusOK) + w.Write([]byte("true")) } else { - w.Write([]byte("false")) w.WriteHeader(http.StatusNoContent) + w.Write([]byte("false")) } } func versionHandler(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(AppName + "/" + Version + "\n")) w.WriteHeader(http.StatusOK) + w.Write([]byte(AppName + "/" + Version + "\n")) } func getArgs(r *http.Request) ([]string, error) { -- cgit v1.2.3