You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support webp and avif image formats in mimetypes #89802
Modern image types webp and avif are not recognized by the mimetypes module.
Problem: Many tools are written in Python and running on macOS. Good example is the AWS CLI. Running commands like "s3 sync" will save files with .webp and .avif extensions with incorrect "binary/octet-stream" Content-Type to S3. This creates additional problems with serving these resources over HTTP.
Activity
kixorz commentedon Oct 28, 2021
Modern image types webp and avif are not recognized by the mimetypes module.
Problem: Many tools are written in Python and running on macOS. Good example is the AWS CLI. Running commands like "s3 sync" will save files with .webp and .avif extensions with incorrect "binary/octet-stream" Content-Type to S3. This creates additional problems with serving these resources over HTTP.
The webp and avif image types are supported by most browsers: https://caniuse.com/#feat=webp
https://caniuse.com/#feat=avif
While webp is fully supported and largely used, it is not officially registered with IANA.
Avif is currently less popular, it is fully registered with IANA.
https://www.iana.org/assignments/media-types/media-types.xhtml
Please consider the attached GitHub PR as a fix to these MIME Content-Type issues.
[-]Support modern image formats in MIME types[/-][+]Support webp and aivf image formats in mimetypes[/+][-]Support modern image formats in MIME types[/-][+]Support webp and aivf image formats in mimetypes[/+][-]Support webp and aivf image formats in mimetypes[/-][+]Support webp and avif image formats in mimetypes[/+][-]Support webp and aivf image formats in mimetypes[/-][+]Support webp and avif image formats in mimetypes[/+]JelleZijlstra commentedon May 3, 2022
Thanks for your contribution!