LibCore: Support the WebM file extension when determining MIME type

This enables, for example, navigating to a file:// URL in Ladybird with
a .webm file extension.
This commit is contained in:
Timothy Flynn 2023-05-15 12:24:26 -04:00 committed by Andreas Kling
parent 63d2b26b17
commit bcfa4a34a1
Notes: sideshowbarker 2024-07-17 01:06:10 +09:00

View file

@ -100,6 +100,8 @@ StringView guess_mime_type_based_on_filename(StringView path)
return "text/csv"sv;
if (path.ends_with(".sheets"sv, CaseSensitivity::CaseInsensitive))
return "application/x-sheets+json"sv;
if (path.ends_with(".webm"sv, CaseSensitivity::CaseInsensitive))
return "video/webm"sv;
// FIXME: Share this, TextEditor and HackStudio language detection somehow.
auto basename = LexicalPath::basename(path);
if (path.ends_with(".cpp"sv, CaseSensitivity::CaseInsensitive)