Problem/Motivation
Some file extensions in field.field.media.document.field_media_document.yml are missing from ExtensionMimeTypeGuesser, which can cause some issues as reported in #3466462: Fix handling of unknown file extensions in FileMediaFormatterBase.
The following file extensions are missing completely: fodt fods fodp fodg numbers pages
The .key extension is present, but is mapped to application/pgp-keys, to which it was historically mapped (along with .asc). Its official media type according to IANA is now application/vnd.apple.keynote, so perhaps it's time to update the mapping.
Steps to reproduce
- Manually configure the *.fodt, *.fods, *.fodp, *.fodg, *.numbers or *.pages file extension as an allowed upload file type, or have them configured automatically via the document media type recipe, the standard profile or the Umami demo profile.
- Upload one of these file types to a file field or as a media document.
- The resulting file entity will have the fallback "application/octet-stream" MIME type (which is visible in the database, and also sent as an HTTP header for private downloads) rather than an appropriate specific MIME type.
Proposed resolution
- Re-map .key from application/pgp-keys to application/vnd.apple.keynote
- Map .numbers application/vnd.apple.numbers
- Map .pages to application/vnd.apple.pages
- Map .fodg to application/vnd.oasis.opendocument.graphics-flat-xml
- Map .fodp to application/vnd.oasis.opendocument.presentation-flat-xml
- Map .fods to application/vnd.oasis.opendocument.spreadsheet-flat-xml
- Map .fodt to application/vnd.oasis.opendocument.text-flat-xml
- While we're here, fix alphabetical order of application/json