I don't think we should be enforcing a specific content type (or limit the content types) on HTTP error responses. I don't see a requirement for that in RFC 7033 or RFC 2616.
For example, Drupal returns application/jrd+json with content {} (a valid JRD) for at least some 4xx responses. I think that should not be considered a failure, even though it's an "interesting" choice.
If we are going to do any checks, it would be reasonable to verify that an application/jrd+json is a valid JRD or application/json can be parsed as JSON. The same could be done for HTML and other content types, but that seems a little extreme.
I don't think we should be enforcing a specific content type (or limit the content types) on HTTP error responses. I don't see a requirement for that in RFC 7033 or RFC 2616.
For example, Drupal returns
application/jrd+json
with content{}
(a valid JRD) for at least some 4xx responses. I think that should not be considered a failure, even though it's an "interesting" choice.If we are going to do any checks, it would be reasonable to verify that an
application/jrd+json
is a valid JRD orapplication/json
can be parsed as JSON. The same could be done for HTML and other content types, but that seems a little extreme.