gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts#20199
gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts#20199hugovk merged 10 commits intopython:mainfrom
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
| 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.
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.
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.
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/