🐛 bug: also hack in content-type for HTML pages

main
_ 2022-12-31 03:06:23 +00:00
parent 292ade0f46
commit a838d80d38
1 changed files with 3 additions and 0 deletions

View File

@ -220,6 +220,9 @@ async fn serve_file (
if uri.ends_with (".js") { if uri.ends_with (".js") {
response.header ("content-type".into (), b"application/javascript".to_vec ()); 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 ()); response.header ("content-length".into (), content_length.to_string ().into_bytes ());