Project

General

Profile

Actions

Feature #44385

open

Replace MiniMime with Marcel in Redmine::MimeType

Added by Go MAEDA about 12 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Resolution:

Description

Redmine currently uses two MIME type databases:

  • MiniMime, used by Redmine::MimeType to look up a type from a file extension.
  • Marcel, used by Attachment and Redmine::Thumbnail to 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

No data to display

Actions

Also available in: Atom PDF