From 78ef78f3420d691b41099a09e7caa2630e1af707 Mon Sep 17 00:00:00 2001 From: neri Date: Mon, 20 Dec 2021 15:40:49 +0100 Subject: [PATCH] cleanup text response code --- src/download.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/download.rs b/src/download.rs index 2106e68..252a20c 100644 --- a/src/download.rs +++ b/src/download.rs @@ -141,8 +141,9 @@ async fn build_text_response(path: &Path) -> Result { } else { TEXT_VIEW_HTML.replace("{text}", &encoded) }; - let response = HttpResponse::Ok().content_type("text/html").body(html); - Ok(response) + Ok(HttpResponse::Ok() + .content_type(TEXT_HTML.to_string()) + .body(html)) } fn build_file_response(