ipn/localapi: more http status cleanup (#10995)

Use Http.StatusOk instead of 200

Updates #cleanup
This commit is contained in:
kari-ts 2024-02-05 09:34:41 -08:00 committed by GitHub
parent a633a30711
commit 5595b61b96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1991,7 +1991,7 @@ type wrapRequest struct {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
w.Write([]byte(wrappedKey))
}
@ -2045,7 +2045,7 @@ func (h *Handler) serveTKADisable(w http.ResponseWriter, r *http.Request) {
http.Error(w, "network-lock disable failed: "+err.Error(), http.StatusBadRequest)
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
}
func (h *Handler) serveTKALocalDisable(w http.ResponseWriter, r *http.Request) {
@ -2069,7 +2069,7 @@ func (h *Handler) serveTKALocalDisable(w http.ResponseWriter, r *http.Request) {
http.Error(w, "network-lock local disable failed: "+err.Error(), http.StatusBadRequest)
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
}
func (h *Handler) serveTKALog(w http.ResponseWriter, r *http.Request) {
@ -2391,7 +2391,7 @@ func (h *Handler) serveDebugCapture(w http.ResponseWriter, r *http.Request) {
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
w.(http.Flusher).Flush()
h.b.StreamDebugCapture(r.Context(), w)
}