inadarei / rfc-healthcheck

Health Check Response RFC Draft for HTTP APIs
https://inadarei.github.io/rfc-healthcheck/
MIT License
117 stars 13 forks source link

Status code definition #77

Open smoyer64 opened 2 years ago

smoyer64 commented 2 years ago

There was a previous issue related to the use of a 4xx status code for fail which has now been closed. There seemed to be agreement that returning the status code of a dependent service could be useful but I'd like to agree with the original premise of that issue - an "HTTP Client Error" should not be returned from a healthcheck. The offending text is in section 3.1 and reads:

For "fail" status, HTTP response code in the 4xx-5xx range MUST be used.

The RFC that defines HTTP Status Codes contradicts the use of a 4xx as an indication of a server errors in section 10.4 - it's probably still appropriate for actual client errors (e.g. the client trying to access the healthcheck doesn't have permission).

inadarei commented 2 years ago

You are 100% correct on this, Steve. This should be fixed.