Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
set error content type to json
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Jun 21, 2021
1 parent 1e4592d commit f91a3bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meilisearch-http/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f91a3bc

Please sign in to comment.