MIME: use "jpg" as extension for image/jpeg even with newer MIME data

Seems newer MIME data returns "jfif", which no one really uses.
This commit is contained in:
Moritz Bunkus 2022-04-26 23:37:47 +02:00
parent d0c63c5f26
commit fb69502347
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -60,8 +60,10 @@ primary_file_extension_for_type(std::string const &type_name) {
auto q_type_name = Q(type_name).toLower();
for (auto const &type : all_types)
if (type.name() == q_type_name)
return to_utf8(type.preferredSuffix());
if (type.name() == q_type_name) {
auto extension = to_utf8(type.preferredSuffix());
return extension == "jfif" ? "jpg"s : extension;
}
return {};
}