Check extension of files in case-insensitive way

This commit is contained in:
Dmitry Bogatov
2019-08-15 00:01:44 +00:00
committed by holger krekel
parent 6beea86df7
commit aa7a149560

View File

@@ -299,7 +299,7 @@ pub fn dc_msg_guess_msgtype_from_suffix(path: &Path) -> Option<(Viewtype, &str)>
"vcf" => (Viewtype::File, "text/vcard"),
"vcard" => (Viewtype::File, "text/vcard"),
};
let extension = path.extension()?.to_str()?;
let extension: &str = &path.extension()?.to_str()?.to_lowercase();
KNOWN.get(extension).map(|x| *x)
}