Skip to content

Commit

Permalink
ipn/localapi: more http status cleanup (tailscale#10995)
Browse files Browse the repository at this point in the history
Use Http.StatusOk instead of 200

Updates #cleanup
  • Loading branch information
kari-ts committed Feb 5, 2024
1 parent a633a30 commit 5595b61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ipn/localapi/localapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ func (h *Handler) serveTKAWrapPreauthKey(w http.ResponseWriter, r *http.Request)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
w.Write([]byte(wrappedKey))
}

Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 5595b61

Please sign in to comment.