Fix proxy error codes

master
James Mills 1 month ago
parent a232af3443
commit fe04fff4c0
Signed by untrusted user who does not match committer: prologic
GPG Key ID: AC4C014F1440EBD6
  1. 4
      internal/proxy.go

@ -70,14 +70,14 @@ func (s *Server) ProxyHandler() httprouter.Handle {
if err != nil {
msg := fmt.Sprintf("error making request to %s: %s", uri, err)
log.WithError(err).Error(msg)
http.Error(w, msg, http.StatusInsufficientStorage)
http.Error(w, msg, http.StatusBadGateway)
return
}
if n, err := io.Copy(w, res.Body()); err != nil {
msg := fmt.Sprintf("error copying proxied response (%d bytes copied)", n)
log.WithError(err).Error(msg)
http.Error(w, msg, http.StatusInsufficientStorage)
http.Error(w, msg, http.StatusInternalServerError)
return
}
}

Loading…
Cancel
Save