From 2bbc62e6ea012985b4ef01fdcfab21a4a0d06f68 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 5 Mar 2023 22:55:49 +0800 Subject: [PATCH] feat: more content types --- post-rs/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post-rs/src/main.rs b/post-rs/src/main.rs index cf2b20a..eed8ee9 100644 --- a/post-rs/src/main.rs +++ b/post-rs/src/main.rs @@ -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()