From 332d741f212eb2aac7bfb2eec1df1f33bfb46a05 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Thu, 6 Jan 2022 14:30:46 +0100 Subject: Use Template::MIME_TYPE instead of extension --- askama_gotham/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'askama_gotham/src') diff --git a/askama_gotham/src/lib.rs b/askama_gotham/src/lib.rs index 1241c9c..c2c933d 100644 --- a/askama_gotham/src/lib.rs +++ b/askama_gotham/src/lib.rs @@ -8,13 +8,13 @@ pub use gotham::handler::IntoResponse; pub use gotham::state::State; pub use hyper::{Body, Response, StatusCode}; -pub fn respond(t: &T, ext: &str) -> Response { +pub fn respond(t: &T, _ext: &str) -> Response { match t.render() { Ok(body) => Response::builder() .status(StatusCode::OK) .header( - "content-type", - mime::extension_to_mime_type(ext).to_string(), + hyper::header::CONTENT_TYPE, + hyper::header::HeaderValue::from_static(T::MIME_TYPE), ) .body(body.into()) .unwrap(), -- cgit