Fix HTTP server content type (#608)

This commit is contained in:
Vincent Ollivier 2024-04-02 20:45:53 +02:00 committed by GitHub
parent 3862a01513
commit 6ab9ad713b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ fn get(req: &Request, res: &mut Response) {
}
if let Ok(buf) = fs::read_to_bytes(&real_path) {
res.code = 200;
res.mime = content_type(&res.real_path);
res.mime = content_type(&real_path);
let tmp;
res.body.extend_from_slice(
if res.mime.starts_with("text/") {