Navigation Menu

Skip to content

Commit

Permalink
Forced mime type for xml files.
Browse files Browse the repository at this point in the history
-----
Forzado el tipo mime para los archivos xml.
  • Loading branch information
NeoRazorX committed May 3, 2022
1 parent 49e1936 commit 31a6b60
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Core/App/AppRouter.php
Expand Up @@ -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);
Expand Down

0 comments on commit 31a6b60

Please sign in to comment.