1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

templates: replace tera with minijinja

This commit is contained in:
Quentin Gliech
2023-10-02 14:41:07 +02:00
parent 536bf4907b
commit 995bdfc13b
45 changed files with 370 additions and 314 deletions

View File

@@ -409,7 +409,7 @@ where
// Error responses should have an ErrorContext attached to them
let ext = response.extensions().get::<ErrorContext>();
if let Some(ctx) = ext {
if let Ok(res) = templates.render_error(ctx).await {
if let Ok(res) = templates.render_error(ctx) {
let (mut parts, _original_body) = response.into_parts();
parts.headers.remove(CONTENT_TYPE);
parts.headers.remove(CONTENT_LENGTH);
@@ -437,7 +437,7 @@ pub async fn fallback(
let ctx = NotFoundContext::new(&method, version, &uri);
// XXX: this should look at the Accept header and return JSON if requested
let res = templates.render_not_found(&ctx).await?;
let res = templates.render_not_found(&ctx)?;
Ok((StatusCode::NOT_FOUND, Html(res)))
}