Hello! We are running our annual fundraising. Please consider making a donation if you value this freely available service or want to support people around the world working towards liberatory social change. https://riseup.net/donate.

Unverified Commit 1e22b980 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[bug] write headers before sending response

- Closes: #436
parent e9c0e2ed
Pipeline #54040 passed with stages
in 19 minutes and 38 seconds
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment