From 9f5213cf42165dd36133a2e6bcdf0e77b81edfb2 Mon Sep 17 00:00:00 2001 From: maokwen Date: Thu, 28 Dec 2023 12:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20explicit=20`content-type`?= =?UTF-8?q?=20header=20for=20the=20search=20page=20response=20(#458)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/routes/search.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/server/routes/search.rs b/src/server/routes/search.rs index 84ba3de..bfd7e76 100644 --- a/src/server/routes/search.rs +++ b/src/server/routes/search.rs @@ -68,16 +68,18 @@ pub async fn search( get_results(page + 1) ); - Ok(HttpResponse::Ok().body( - crate::templates::views::search::search( - &config.style.colorscheme, - &config.style.theme, - &config.style.animation, - query, - &results?, - ) - .0, - )) + Ok(HttpResponse::Ok() + .content_type("text/html; charset=utf-8") + .body( + crate::templates::views::search::search( + &config.style.colorscheme, + &config.style.theme, + &config.style.animation, + query, + &results?, + ) + .0, + )) } None => Ok(HttpResponse::TemporaryRedirect() .insert_header(("location", "/"))