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_axum/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'askama_axum') diff --git a/askama_axum/src/lib.rs b/askama_axum/src/lib.rs index 21217ff..1048674 100644 --- a/askama_axum/src/lib.rs +++ b/askama_axum/src/lib.rs @@ -10,13 +10,13 @@ pub use http::Response; use http::StatusCode; use http_body::{Empty, Full}; -pub fn into_response(t: &T, ext: &str) -> Response { +pub fn into_response(t: &T, _ext: &str) -> Response { match t.render() { Ok(body) => Response::builder() .status(StatusCode::OK) .header( - "content-type", - askama::mime::extension_to_mime_type(ext).to_string(), + http::header::CONTENT_TYPE, + http::HeaderValue::from_static(T::MIME_TYPE), ) .body(body::boxed(Full::from(body))) .unwrap(), -- cgit