gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts (#20199)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Sahil Prajapati 2024-11-12 12:18:38 +05:30 committed by GitHub
parent c45be8aa71
commit 599bfc986d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 0 deletions

View File

@ -366,6 +366,16 @@ json
mimetypes
---------
* Add MS and :rfc:`8081` MIME types for fonts:
* Embedded OpenType: ``application/vnd.ms-fontobject``
* OpenType Layout (OTF) ``font/otf``
* TrueType: ``font/ttf``
* WOFF 1.0 ``font/woff``
* WOFF 2.0 ``font/woff2``
(Contributed by Sahil Prajapati and Hugo van Kemenade in :gh:`84852`.)
* Add :rfc:`9559` MIME types for Matroska audiovisual data container
structures, containing:

View File

@ -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',
@ -543,6 +544,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',
'.avif' : 'image/avif',
'.bmp' : 'image/bmp',
'.gif' : 'image/gif',

View File

@ -228,12 +228,17 @@ class MimeTypesTestCase(unittest.TestCase):
("application/postscript", ".ps"),
("application/vnd.apple.mpegurl", ".m3u"),
("application/vnd.ms-excel", ".xls"),
("application/vnd.ms-fontobject", ".eot"),
("application/vnd.ms-powerpoint", ".ppt"),
("application/x-texinfo", ".texi"),
("application/x-troff", ".roff"),
("application/xml", ".xsl"),
("audio/matroska", ".mka"),
("audio/mpeg", ".mp3"),
("font/otf", ".otf"),
("font/ttf", ".ttf"),
("font/woff", ".woff"),
("font/woff2", ".woff2"),
("image/avif", ".avif"),
("image/webp", ".webp"),
("image/jpeg", ".jpg"),

View File

@ -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.