aboutsummaryrefslogtreecommitdiffstats
path: root/askama_rocket
diff options
context:
space:
mode:
Diffstat (limited to 'askama_rocket')
-rw-r--r--askama_rocket/src/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/askama_rocket/src/lib.rs b/askama_rocket/src/lib.rs
index 33bd779..f10ba87 100644
--- a/askama_rocket/src/lib.rs
+++ b/askama_rocket/src/lib.rs
@@ -5,16 +5,15 @@
use std::io::Cursor;
pub use askama::*;
-use rocket::http::{ContentType, Status};
+use rocket::http::{Header, Status};
pub use rocket::request::Request;
use rocket::response::Response;
pub use rocket::response::{Responder, Result};
-pub fn respond<T: Template>(t: &T, ext: &str) -> Result<'static> {
+pub fn respond<T: Template>(t: &T, _ext: &str) -> Result<'static> {
let rsp = t.render().map_err(|_| Status::InternalServerError)?;
- let ctype = ContentType::from_extension(ext).ok_or(Status::InternalServerError)?;
Response::build()
- .header(ctype)
+ .header(Header::new("content-type", T::MIME_TYPE))
.sized_body(Cursor::new(rsp))
.ok()
}