Browse Source

LibCore: Add text/css mime type

Firefox throws out css files with MIME type not being "text/css", so
let's add it to make attached CSS working on WebServer. :^)
Maciej 3 years ago
parent
commit
b172bf4f84
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Userland/Libraries/LibCore/MimeData.cpp

+ 2 - 0
Userland/Libraries/LibCore/MimeData.cpp

@@ -75,6 +75,8 @@ String guess_mime_type_based_on_filename(StringView path)
         return "text/markdown";
     if (path.ends_with(".html", CaseSensitivity::CaseInsensitive) || path.ends_with(".htm", CaseSensitivity::CaseInsensitive))
         return "text/html";
+    if (path.ends_with(".css", CaseSensitivity::CaseInsensitive))
+        return "text/css";
     if (path.ends_with(".js", CaseSensitivity::CaseInsensitive))
         return "application/javascript";
     if (path.ends_with(".json", CaseSensitivity::CaseInsensitive))