This commit is contained in:
Mutzi 2023-10-23 14:00:14 +02:00
parent ee059a9747
commit 3fb17e6fec
Signed by: root
GPG Key ID: 2437494E09F13876

View File

@ -58,7 +58,9 @@ static const std::unordered_map<std::string, std::string> mime_type_map = {
static const std::string& get_mime_type(const std::filesystem::path &filename) { static const std::string& get_mime_type(const std::filesystem::path &filename) {
static const std::string octet = "application/octet-stream"; static const std::string octet = "application/octet-stream";
const auto &entry = mime_type_map.find(filename.extension()); std::string ext = filename.extension();
std::transform(ext.begin(), ext.end(), ext.begin(), [](auto c) { return std::tolower(c); });
const auto &entry = mime_type_map.find(ext);
if (entry != mime_type_map.end()) if (entry != mime_type_map.end())
return entry->second; return entry->second;
else else