-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts #20199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
4ce88d1
621f88e
1a0e8ed
578bea4
78dcd11
fc668fd
b08efee
d4cdfdc
2ea2041
77a094a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -479,6 +479,7 @@ def _default_mime_types(): | |
'.m3u8' : 'application/vnd.apple.mpegurl', | ||
'.xls' : 'application/vnd.ms-excel', | ||
'.xlb' : 'application/vnd.ms-excel', | ||
'.eot' : 'application/vnd.ms-fontobject', | ||
'.ppt' : 'application/vnd.ms-powerpoint', | ||
'.pot' : 'application/vnd.ms-powerpoint', | ||
'.ppa' : 'application/vnd.ms-powerpoint', | ||
|
@@ -542,6 +543,10 @@ def _default_mime_types(): | |
'.aiff' : 'audio/x-aiff', | ||
'.ra' : 'audio/x-pn-realaudio', | ||
'.wav' : 'audio/x-wav', | ||
'.otf' : 'font/otf', | ||
'.ttf' : 'font/ttf', | ||
'.woff' : 'font/woff', | ||
'.woff2' : 'font/woff2', | ||
Comment on lines
+547
to
+550
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I verified from the RFC that these 4 lines and hence the corresponding test lines are correct. There is no reference I see for the vnd-ms addition so cannot verify. The merge conflict will be in the tests due to the switch to using subtests, which looks good to me. So merge that first and fix this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for verifying.
|
||
'.avif' : 'image/avif', | ||
'.bmp' : 'image/bmp', | ||
'.gif' : 'image/gif', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,11 +227,16 @@ def check_extensions(): | |
self.assertEqual(mimetypes.guess_extension('application/postscript'), '.ps') | ||
self.assertEqual(mimetypes.guess_extension('application/vnd.apple.mpegurl'), '.m3u') | ||
self.assertEqual(mimetypes.guess_extension('application/vnd.ms-excel'), '.xls') | ||
self.assertEqual(mimetypes.guess_extension('application/vnd.ms-fontobject'), '.eot') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this is going to conflict with the refactoring in #126412. |
||
self.assertEqual(mimetypes.guess_extension('application/vnd.ms-powerpoint'), '.ppt') | ||
self.assertEqual(mimetypes.guess_extension('application/x-texinfo'), '.texi') | ||
self.assertEqual(mimetypes.guess_extension('application/x-troff'), '.roff') | ||
self.assertEqual(mimetypes.guess_extension('application/xml'), '.xsl') | ||
self.assertEqual(mimetypes.guess_extension('audio/mpeg'), '.mp3') | ||
self.assertEqual(mimetypes.guess_extension('font/otf'), '.otf') | ||
self.assertEqual(mimetypes.guess_extension('font/ttf'), '.ttf') | ||
self.assertEqual(mimetypes.guess_extension('font/woff'), '.woff') | ||
self.assertEqual(mimetypes.guess_extension('font/woff2'), '.woff2') | ||
self.assertEqual(mimetypes.guess_extension('image/avif'), '.avif') | ||
self.assertEqual(mimetypes.guess_extension('image/webp'), '.webp') | ||
self.assertEqual(mimetypes.guess_extension('image/jpeg'), '.jpg') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add MIME types for MS Embedded OpenType, OpenType Layout, TrueType, | ||
WOFF 1.0 and 2.0 fonts. Patch by Sahil Prajapati and Hugo van Kemenade. |
Uh oh!
There was an error while loading. Please reload this page.