From 220cbe40e56341edc49223bf262fbacd7ef2621c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Fro=C5=82ow?= Date: Mon, 2 Apr 2018 19:10:33 +0200 Subject: [PATCH] Add header for juniper example --- examples/juniper/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/juniper/src/main.rs b/examples/juniper/src/main.rs index 26f63de95..97319afea 100644 --- a/examples/juniper/src/main.rs +++ b/examples/juniper/src/main.rs @@ -14,7 +14,7 @@ extern crate env_logger; use actix::prelude::*; use actix_web::{ - middleware, http, server, + middleware, http::{self, header::CONTENT_TYPE}, server, App, AsyncResponder, HttpRequest, HttpResponse, HttpMessage, Error}; use juniper::http::graphiql::graphiql_source; use juniper::http::GraphQLRequest; @@ -79,7 +79,7 @@ fn graphql(req: HttpRequest) -> Box Ok(HttpResponse::Ok().body(user)), + Ok(user) => Ok(HttpResponse::Ok().header(CONTENT_TYPE, "application/json").body(user)), Err(_) => Ok(HttpResponse::InternalServerError().into()) } })