aboutsummaryrefslogtreecommitdiffstats
path: root/askama_axum/src
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-06 14:30:46 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-07 13:18:03 +0100
commit332d741f212eb2aac7bfb2eec1df1f33bfb46a05 (patch)
treef7f2d529d3db59beae9e28db8c3938e37d6a8f20 /askama_axum/src
parenta9aebf82fbb59a0323c78c4c248eaaafab1ab00f (diff)
downloadaskama-332d741f212eb2aac7bfb2eec1df1f33bfb46a05.tar.gz
askama-332d741f212eb2aac7bfb2eec1df1f33bfb46a05.tar.bz2
askama-332d741f212eb2aac7bfb2eec1df1f33bfb46a05.zip
Use Template::MIME_TYPE instead of extension
Diffstat (limited to 'askama_axum/src')
-rw-r--r--askama_axum/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
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: Template>(t: &T, ext: &str) -> Response<BoxBody> {
+pub fn into_response<T: Template>(t: &T, _ext: &str) -> Response<BoxBody> {
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(),