mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user