feat: more content types

This commit is contained in:
2023-03-05 22:55:49 +08:00
parent d874cbd0a4
commit 2bbc62e6ea

View File

@@ -116,7 +116,11 @@ fn main() {
fn get_content_type(file_name: &str) -> String {
let file_name = file_name.to_ascii_lowercase();
if file_name.ends_with(".txt") {
if file_name.ends_with(".txt")
|| file_name.ends_with(".text")
|| file_name.ends_with(".diff")
|| file_name.ends_with(".md")
|| file_name.ends_with(".markdown") {
"text/plain".into()
} else if file_name.ends_with(".aac") {
"audio/aac".into()