summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-02-16 20:32:21 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-02-16 20:32:32 +0100
commit1e22b980abae96b40428a67f2dc4a12df1156a3d (patch)
treefa2c810db579362439b71340483e782416eb7c98
parente9c0e2edf44d6d185ae02adfc88b3ddabf660776 (diff)
[bug] write headers before sending response
- Closes: #436
-rw-r--r--pkg/helper/helper.go6
1 files changed, 3 insertions, 3 deletions
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) {