diff --git a/src/server/http.rs b/src/server/http.rs index 615cbba..68d7a2b 100644 --- a/src/server/http.rs +++ b/src/server/http.rs @@ -186,6 +186,10 @@ fn get_content_type(file_path: &str) -> &'static str { "audio/mpeg" } else if file_path.ends_with(".mp4") { "video/mp4" + } else if file_path.ends_with(".pdf") { + "application/pdf" + } else if file_path.ends_with(".md") { + "text/markdown" } else { "text/plain" } @@ -354,4 +358,4 @@ fn log_to_file(message: &str) { let log_message = format!("[{}] {}\n", timestamp, message); let _ = file.write_all(log_message.as_bytes()); } -} +} \ No newline at end of file