Is it correct to return a 502 status code when it's my proxy that has an internal error?

StackOverflow https://stackoverflow.com/questions/5934051

  •  30-10-2019
  •  | 
  •  

문제

I've written a small proxy, and I'm wondering if it's correct for me to return a 502 Bad Gateway error when the proxy server itself has an internal error. The RFC seem to say that this is something you only do if the server on the other end gives a bad response.

The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

I take this to mean that if for example the upstream server is setting a content-length header that is different from the response body length, we should set a 502 error i.e. when the response is invalid.

Am I misinterpreting the RFC?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top