1
0
mirror of synced 2024-11-22 04:46:05 +03:00

Put back mandatory 200 OK

This commit is contained in:
Sergey Parshukov 2019-07-31 00:43:42 +03:00
parent 7599daf34a
commit f404f6afa4
No known key found for this signature in database
GPG Key ID: 9D0FB8D5E702923A

View File

@ -305,12 +305,7 @@ func (m *Messenger) handle(w http.ResponseWriter, r *http.Request) {
func respond(w http.ResponseWriter, code int) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(code)
if code < 400 {
fmt.Fprintln(w, `{"status": "ok"}`)
} else {
fmt.Fprintln(w, `{"status": "not ok"}`)
}
fmt.Fprintf(w, `{"code": %d, "status": "%s"}`, code, http.StatusText(code))
}
// checkIntegrity checks the integrity of the requests received