-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hi, @tiran @csabella any estimation on if and when this will be merged? |
Thanks @azimovMichael for the suggestion, will use dynamic approach currently. |
the changes were made and tiran removed their request for review
I've updated this to fix the merge conflict, use the RFC 8081 MIME types, corrected the Embedded OpenType (EOT) MIME type (append |
Lib/test/test_mimetypes.py
Outdated
@@ -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 comment
The 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.
'.otf' : 'font/otf', | ||
'.ttf' : 'font/ttf', | ||
'.woff' : 'font/woff', | ||
'.woff2' : 'font/woff2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for verifying.
application/vnd.ms-fontobject
is vendor specific and can be seen for example at:
Thank you @sahil290791 for the initial PR and everyone else for the reviews! |
Thanks @hugovk and the reviewers for getting this reviewed and merged. 😃 |
… fonts (python#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>
… fonts (python#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>
Add missing font mime types
Fixes #84852.
Currently the guess_type method doesnt work for fonts of type: .eot, .woff, .woff2, .otf and .ttf
I have added the neccessary mimetypes for these fonts
Reference: https://codingstill.com/2013/01/set-mime-types-for-web-fonts-in-iis/