We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f8fcc5 commit 5face5fCopy full SHA for 5face5f
src/PhpDebugBarMiddleware.php
@@ -107,12 +107,21 @@ private function getContentTypeByFileName($filename)
107
{
108
$ext = pathinfo($filename, PATHINFO_EXTENSION);
109
110
- switch ($ext) {
111
- case 'css':
112
- return 'text/css';
113
- case 'js':
114
- return 'text/javascript';
+ $map = [
+ 'css' => 'text/css',
+ 'js' => 'text/javascript',
+ 'otf' => 'font/opentype',
+ 'eot' => 'application/vnd.ms-fontobject',
115
+ 'svg' => 'image/svg+xml',
116
+ 'ttf' => 'application/font-sfnt',
117
+ 'woff' => 'application/font-woff',
118
+ 'woff2' => 'application/font-woff2',
119
+ ];
120
+
121
+ if (isset($map[$ext])) {
122
+ return $map[$ext];
123
}
124
125
return 'text/plain';
126
127
0 commit comments