fix: properly set charset

This commit is contained in:
Compositr 2024-11-02 17:33:36 +11:00
parent 98394d2885
commit cd56355603

View file

@ -54,7 +54,7 @@ fn send_response(mut stream: TcpStream, status: u16, body: Body) -> UnitOrBoxedE
Body::Bytes(_, content_type) => {
response.push_str(&format!("Content-Type: {}\r\n", content_type))
}
Body::Static(_) => response.push_str("Content-Type: text/plain\r\n"),
Body::Static(_) => response.push_str("Content-Type: text/plain; charset=utf-8\r\n"),
_ => {}
}
response.push_str("\r\n");