cleanup text response code

This commit is contained in:
neri 2021-12-20 15:40:49 +01:00
parent 48574b1ec3
commit 78ef78f342
1 changed files with 3 additions and 2 deletions

View File

@ -141,8 +141,9 @@ async fn build_text_response(path: &Path) -> Result<HttpResponse, Error> {
} 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(