From f06679eea0cf1110e68949de01cd4545944f4ac2 Mon Sep 17 00:00:00 2001 From: Stuart Chinery Date: Fri, 1 Mar 2024 17:35:36 +0000 Subject: [PATCH] Use Marcel::Magic.new instead of private constant --- lib/carrierwave/downloader/remote_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/carrierwave/downloader/remote_file.rb b/lib/carrierwave/downloader/remote_file.rb index ce2ceb79e..851b31dfd 100644 --- a/lib/carrierwave/downloader/remote_file.rb +++ b/lib/carrierwave/downloader/remote_file.rb @@ -33,7 +33,7 @@ def headers def original_filename filename = filename_from_header || filename_from_uri - extensions = Marcel::TYPE_EXTS[content_type] + extensions = Marcel::Magic.new(content_type).extensions unless File.extname(filename).present? || extensions.blank? extension = extensions.first filename = "#{filename}.#{extension}"