8000 CS and mime type -> media type terminology · symfony/symfony@5c9fb34 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c9fb34

Browse files
committed
CS and mime type -> media type terminology
1 parent 72744ac commit 5c9fb34

File tree

1 file changed

+69
-69
lines changed

1 file changed

+69
-69
lines changed

src/Symfony/Component/AssetMapper/AssetMapperDevServerSubscriber.php

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -29,72 +29,72 @@ final class AssetMapperDevServerSubscriber implements EventSubscriberInterface
2929
// source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
3030
private const EXTENSIONS_MAP = [
3131
'aac' => 'audio/aac',
32-
'abw' => 'application/x-abiword',
33-
'arc' => 'application/x-freearc',
34-
'avif' => 'image/avif',
35-
'avi' => 'video/x-msvideo',
36-
'azw' => 'application/vnd.amazon.ebook',
37-
'bin' => 'application/octet-stream',
38-
'bmp' => 'image/bmp',
39-
'bz' => 'application/x-bzip',
40-
'bz2' => 'application/x-bzip2',
41-
'cda' => 'application/x-cdf',
42-
'csh' => 'application/x-csh',
43-
'css' => 'text/css',
44-
'csv' => 'text/csv',
45-
'doc' => 'application/msword',
46-
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
47-
'eot' => 'application/vnd.ms-fontobject',
48-
'epub' => 'application/epub+zip',
49-
'gz' => 'application/gzip',
50-
'gif' => 'image/gif',
51-
'htm' => 'text/html',
52-
'html' => 'text/html',
53-
'ico' => 'image/vnd.microsoft.icon',
54-
'ics' => 'text/calendar',
55-
'jar' => 'application/java-archive',
56-
'jpeg' => 'image/jpeg',
57-
'jpg' => 'image/jpeg',
58-
'js' => 'text/javascript',
59-
'json' => 'application/json',
60-
'jsonld' => 'application/ld+json',
61-
'mid' => 'audio/midi',
62-
'midi' => 'audio/midi',
63-
'mjs' => 'text/javascript',
64-
'mp3' => 'audio/mpeg',
65-
'mp4' => 'video/mp4',
66-
'mpeg' => 'video/mpeg',
67-
'mpkg' => 'application/vnd.apple.installer+xml',
68-
'odp' => 'application/vnd.oasis.opendocument.presentation',
69-
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
70-
'odt' => 'application/vnd.oasis.opendocument.text',
71-
'oga' => 'audio/ogg',
72-
'ogv' => 'video/ogg',
73-
'ogx' => 'application/ogg',
74-
'opus' => 'audio/opus',
75-
'otf' => 'font/otf',
76-
'png' => 'image/png',
77-
'pdf' => 'application/pdf',
78-
'php' => 'application/x-httpd-php',
79-
'ppt' => 'application/vnd.ms-powerpoint',
80-
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
81-
'rar' => 'application/vnd.rar',
82-
'rtf' => 'application/rtf',
83-
'sh' => 'application/x-sh',
84-
'svg' => 'image/svg+xml',
85-
'tar' => 'application/x-tar',
86-
'tif' => 'image/tiff',
87-
'tiff' => 'image/tiff',
88-
'ts' => 'video/mp2t',
89-
'ttf' => 'font/ttf',
90-
'txt' => 'text/plain',
91-
'vsd' => 'application/vnd.visio',
92-
'wav' => 'audio/wav',
93-
'weba' => 'audio/webm',
94-
'webm' => 'video/webm',
95-
'webp' => 'image/webp',
96-
'woff' => 'font/woff',
97-
'woff2' => 'font/woff2',
32+
'abw' => 'application/x-abiword',
33+
'arc' => 'application/x-freearc',
34+
'avif' => 'image/avif',
35+
'avi' => 'video/x-msvideo',
36+
'azw' => 'application/vnd.amazon.ebook',
37+
'bin' => 'application/octet-stream',
38+
'bmp' => 'image/bmp',
39+
'bz' => 'application/x-bzip',
40+
'bz2' => 'application/x-bzip2',
41+
'cda' => 'application/x-cdf',
42+
'csh' => 'application/x-csh',
43+
'css' => 'text/css',
44+
'csv' => 'text/csv',
45+
'doc' => 'application/msword',
46+
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
47+
'eot' => 'application/vnd.ms-fontobject',
48+
'epu 6D4E b' => 'application/epub+zip',
49+
'gz' => 'application/gzip',
50+
'gif' => 'image/gif',
51+
'htm' => 'text/html',
52+
'html' => 'text/html',
53+
'ico' => 'image/vnd.microsoft.icon',
54+
'ics' => 'text/calendar',
55+
'jar' => 'application/java-archive',
56+
'jpeg' => 'image/jpeg',
57+
'jpg' => 'image/jpeg',
58+
'js' => 'text/javascript',
59+
'json' => 'application/json',
60+
'jsonld' => 'application/ld+json',
61+
'mid' => 'audio/midi',
62+
'midi' => 'audio/midi',
63+
'mjs' => 'text/javascript',
64+
'mp3' => 'audio/mpeg',
65+
'mp4' => 'video/mp4',
66+
'mpeg' => 'video/mpeg',
67+
'mpkg' => 'application/vnd.apple.installer+xml',
68+
'odp' => 'application/vnd.oasis.opendocument.presentation',
69+
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
70+
'odt' => 'application/vnd.oasis.opendocument.text',
71+
'oga' => 'audio/ogg',
72+
'ogv' => 'video/ogg',
73+
'ogx' => 'application/ogg',
74+
'opus' => 'audio/opus',
75+
'otf' => 'font/otf',
76+
'png' => 'image/png',
77+
'pdf' => 'application/pdf',
78+
'php' => 'application/x-httpd-php',
79+
'ppt' => 'application/vnd.ms-powerpoint',
80+
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
81+
'rar' => 'application/vnd.rar',
82+
'rtf' => 'application/rtf',
83+
'sh' => 'application/x-sh',
84+
'svg' => 'image/svg+xml',
85+
'tar' => 'application/x-tar',
86+
'tif' => 'image/tiff',
87+
'tiff' => 'image/tiff',
88+
'ts' => 'video/mp2t',
89+
'ttf' => 'font/ttf',
90+
'txt' => 'text/plain',
91+
'vsd' => 'application/vnd.visio',
92+
'wav' => 'audio/wav',
93+
'weba' => 'audio/webm',
94+
'webm' => 'video/webm',
95+
'webp' => 'image/webp',
96+
'woff' => 'font/woff',
97+
'woff2' => 'font/woff2',
9898
];
9999

100100
private readonly string $publicPrefix;
@@ -132,10 +132,10 @@ public function onKernelRequest(RequestEvent $event): void
132132
throw new NotFoundHttpException(sprintf('Asset with public path "%s" not found.', $pathInfo));
133133
}
134134

135-
$mimeType = $this->getMimeType($asset->getPublicPath());
135+
$mediaType = $this->getMediaType($asset->getPublicPath());
136136
$response = (new Response(
137137
$asset->getContent(),
138-
headers: $mimeType ? ['Content-Type' => $mimeType] : [],
138+
headers: $mediaType ? ['Content-Type' => $mediaType] : [],
139139
))
140140
->setPublic()
141141
->setMaxAge(604800)
@@ -154,7 +154,7 @@ public static function getSubscribedEvents(): array
154154
];
155155
}
156156

157-
private function getMimeType(string $path): ?string
157+
private function getMediaType(string $path): ?string
158158
{
159159
$extension = pathinfo($path, \PATHINFO_EXTENSION);
160160

0 commit comments

Comments
 (0)
0