From a838d80d3831605bdd8bf97cdd961416b222ad62 Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sat, 31 Dec 2022 03:06:23 +0000 Subject: [PATCH] :bug: bug: also hack in content-type for HTML pages --- crates/ptth_server/src/file_server.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ptth_server/src/file_server.rs b/crates/ptth_server/src/file_server.rs index 3c13674..8b1d873 100644 --- a/crates/ptth_server/src/file_server.rs +++ b/crates/ptth_server/src/file_server.rs @@ -220,6 +220,9 @@ async fn serve_file ( if uri.ends_with (".js") { response.header ("content-type".into (), b"application/javascript".to_vec ()); } + else if uri.ends_with (".html") { + response.header ("content-type".into (), b"text/html; charset=UTF-8".to_vec ()); + } response.header ("content-length".into (), content_length.to_string ().into_bytes ());