set error content type to json
This commit is contained in:
parent
1e4592dd7e
commit
f91a3bc6ab
|
@ -60,7 +60,9 @@ where T: ErrorCode
|
|||
impl aweb::error::ResponseError for ResponseError {
|
||||
fn error_response(&self) -> aweb::BaseHttpResponse<Body> {
|
||||
let json = serde_json::to_vec(self).unwrap();
|
||||
BaseHttpResponseBuilder::new(self.status_code()).body(json)
|
||||
BaseHttpResponseBuilder::new(self.status_code())
|
||||
.content_type("application/json")
|
||||
.body(json)
|
||||
}
|
||||
|
||||
fn status_code(&self) -> StatusCode {
|
||||
|
|
Loading…
Reference in New Issue