diff --git a/Core/App/AppRouter.php b/Core/App/AppRouter.php index 1de2d09bc9..7d1618cb78 100644 --- a/Core/App/AppRouter.php +++ b/Core/App/AppRouter.php @@ -223,12 +223,16 @@ private function download(string $filePath) */ private function getMime(string $filePath): string { - if ('.css' === substr($filePath, -4)) { - return 'text/css'; - } + $extension = strtolower(pathinfo($filePath, PATHINFO_EXTENSION)); + switch ($extension) { + case 'css': + return 'text/css'; + + case 'js': + return 'application/javascript'; - if ('.js' === substr($filePath, -3)) { - return 'application/javascript'; + case 'xml': + return 'text/xml'; } return mime_content_type($filePath);