From c196a882d5821fc0e38b157033a02d2f05467879 Mon Sep 17 00:00:00 2001 From: Leonard Lorenz Date: Fri, 23 Oct 2020 12:06:19 +0200 Subject: [PATCH] fixed submit content type --- site/src/routes.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/site/src/routes.rs b/site/src/routes.rs index 6a8b7ec..4911206 100644 --- a/site/src/routes.rs +++ b/site/src/routes.rs @@ -36,10 +36,13 @@ async fn blog() -> impl Responder { #[get("/blog/submit")] async fn blog_submit() -> impl Responder { let root_path = config::get_from_env("ROOT_PATH", true); - HttpResponse::Ok().set_header("SameSite", "secure").body( - std::fs::read_to_string(root_path + "/html/submit.html") - .unwrap_or_else(|e| panic!("Error, couldn't load submit html file.\n{}", e)), - ) + HttpResponse::Ok() + .content_type("text/html") + .set_header("SameSite", "secure") + .body( + std::fs::read_to_string(root_path + "/html/submit.html") + .unwrap_or_else(|e| panic!("Error, couldn't load submit html file.\n{}", e)), + ) } #[get("/blog/id/{post_id}")]