acm-uiuc / groot-api-gateway

API Gateway for the Groot project written in Arbor
Other
12 stars 2 forks source link

Non-200 HTTP Response Bodies Dropped by proxy #38

Closed bcongdon closed 7 years ago

bcongdon commented 7 years ago

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 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.

sameetandpotatoes commented 7 years ago

This is already done and in a PR waiting to be approved.

narendasan commented 7 years ago

was addressed in #32