Suppose you reject a request service-side with a 403. err is nil, but res.StatusCode != http.StatusOK, so we call InvalidGET(w, err). Thus, the client sees a 404, get's nil as the server-error. (And doesn't get the error message attached to the original 403)
Obviously, we want to do some sort of panic on a non-200 response, but it would be worth forwarding the response body anyways, IMO.
Error responses are often not getting conveyed through the proxy. Consider: https://github.com/acm-uiuc/groot/blob/master/proxy/GET.go#L49
Suppose you reject a request service-side with a
403
.err
isnil
, butres.StatusCode != http.StatusOK
, so we callInvalidGET(w, err)
. Thus, the client sees a404
, get'snil
as theserver-error
. (And doesn't get the error message attached to the original403
)Obviously, we want to do some sort of panic on a non-200 response, but it would be worth forwarding the response body anyways, IMO.