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_warp/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'askama_warp/src') diff --git a/askama_warp/src/lib.rs b/askama_warp/src/lib.rs index 4220efc..b2f0387 100644 --- a/askama_warp/src/lib.rs +++ b/askama_warp/src/lib.rs @@ -9,14 +9,11 @@ use warp::http::{self, header, StatusCode}; use warp::hyper::Body; use warp::reply::Response; -pub fn reply(t: &T, ext: &str) -> Response { +pub fn reply(t: &T, _ext: &str) -> Response { match t.render() { Ok(body) => http::Response::builder() .status(StatusCode::OK) - .header( - header::CONTENT_TYPE, - mime::extension_to_mime_type(ext).to_string(), - ) + .header(header::CONTENT_TYPE, T::MIME_TYPE) .body(body.into()), Err(_) => http::Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) -- cgit