Add content-type for responses

This commit is contained in:
2019-11-28 13:42:43 +01:00
parent d1dffdf890
commit 16ac1ea7d1

View File

@@ -15,7 +15,11 @@ where
T: Serialize,
{
match serde_json::to_string(data) {
Ok(response) => Ok(Either::A(HttpResponse::Ok().body(response))),
Ok(response) => Ok(Either::A(
HttpResponse::Ok()
.content_type("application/json")
.body(response),
)),
Err(e) => error_500(e),
}
}