|
|
|
@ -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 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|