fix: return content-type for HTTP errors
No "Content-Type" header has ever been returned, even though the response body has always been hard-coded to a JSON string. This commit returns a content type of "application/json" for all JSON-encoded HTTP errors.pull/24376/head
parent
5b6b7cbf86
commit
4aa5826300
|
@ -127,6 +127,7 @@ impl HttpApiError {
|
|||
pub fn response(&self) -> Response<Body> {
|
||||
Response::builder()
|
||||
.status(self.code.status_code())
|
||||
.header("content-type", "application/json")
|
||||
.body(self.body())
|
||||
.unwrap()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue