Actions
Feature #44385
closedReplace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup
Resolution:
Fixed
Description
Redmine currently uses two MIME type databases:
- MiniMime, used by
Redmine::MimeTypeto look up a type from a file extension. - Marcel, used by
AttachmentandRedmine::Thumbnailto detect a type from file contents.
Because the two databases can map the same extension to different MIME types, the result can depend on which code path is used. For example, MiniMime maps .ai to application/pdf, while Marcel maps it to application/illustrator. This inconsistency had to be worked around in #44335 by hardcoding application/illustrator into Redmine::MimeType::MIME_TYPES.
This patch switches Redmine::MimeType from MiniMime to Marcel, so Marcel is used consistently throughout the application.
Benefits:
- The same MIME type database is used throughout Redmine, so the same extension consistently resolves to the same MIME type.
- The workaround added in #44335 is no longer needed and is removed.
- `mini_mime` is no longer a direct dependency and is removed from the Gemfile.
Files
Related issues
Updated by Go MAEDA 21 days ago
- Related to Defect #44335: PDF preview of .ai attachments triggers an automatic download added
- Related to Feature #43484: Detect attachment content type from file contents instead of trusting client-provided values added
Updated by Go MAEDA 21 days ago
- Subject changed from Replace MiniMime with Marcel in Redmine::MimeType to Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the aptch in r25019.
Actions