ipn/{ipnlocal/peerapi, localapi}: cleaning up http statuses for consistency and readability (#9796)

Updates #cleanup

Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
This commit is contained in:
Rhea Ghosh
2023-10-13 17:40:10 -05:00
committed by GitHub
parent 9cb6c5bb78
commit 8c7169105e
2 changed files with 59 additions and 59 deletions

View File

@@ -747,7 +747,7 @@ func (h *peerAPIHandler) handleServeDNSFwd(w http.ResponseWriter, r *http.Reques
}
dh := health.DebugHandler("dnsfwd")
if dh == nil {
http.Error(w, "not wired up", 500)
http.Error(w, "not wired up", http.StatusInternalServerError)
return
}
dh.ServeHTTP(w, r)
@@ -885,9 +885,9 @@ func (h *peerAPIHandler) handleDNSQuery(w http.ResponseWriter, r *http.Request)
if err != nil {
h.logf("handleDNS fwd error: %v", err)
if err := ctx.Err(); err != nil {
http.Error(w, err.Error(), 500)
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
http.Error(w, "DNS forwarding error", 500)
http.Error(w, "DNS forwarding error", http.StatusInternalServerError)
}
return
}