use iron::Response;
use iron::headers::ContentType;
use iron::modifier::Modifier;
use serde::Serialize;
use serde_json::to_string;

#[derive(Clone, Debug)]
pub struct SerializableResponse<T: Serialize>(pub T);

impl<T> Modifier<Response> for SerializableResponse<T> where T: Serialize {
    fn modify(self, response: &mut Response) {
        response.headers.set(ContentType::json());
        response.body = Some(Box::new(to_string(&self.0).expect("could not serialize response data")));
    }
}

use iron::Response;
use iron::modifier::Modifier;
use serde::Serialize;
use serde_json::to_string;

#[derive(Clone, Debug)]
pub struct SerializableResponse<T: Serialize>(pub T);

impl<T> Modifier<Response> for SerializableResponse<T> where T: Serialize {
    fn modify(self, response: &mut Response) {
        response.body = Some(Box::new(to_string(&self.0).expect("could not serialize response data")));
    }
}

--- 
+++ 
@@ -1,4 +1,5 @@
 use iron::Response;
+use iron::headers::ContentType;
 use iron::modifier::Modifier;
 use serde::Serialize;
 use serde_json::to_string;
@@ -8,6 +9,7 @@
 
 impl<T> Modifier<Response> for SerializableResponse<T> where T: Serialize {
     fn modify(self, response: &mut Response) {
+        response.headers.set(ContentType::json());
         response.body = Some(Box::new(to_string(&self.0).expect("could not serialize response data")));
     }
 }
Set the Content-Type header in responses.
