mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
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 {
|
impl aweb::error::ResponseError for ResponseError {
|
||||||
fn error_response(&self) -> aweb::BaseHttpResponse<Body> {
|
fn error_response(&self) -> aweb::BaseHttpResponse<Body> {
|
||||||
let json = serde_json::to_vec(self).unwrap();
|
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 {
|
fn status_code(&self) -> StatusCode {
|
||||||
|
Loading…
Reference in New Issue
Block a user