Skip to content

Commit

Permalink
Merge pull request #2728 from schinery/main
Browse files Browse the repository at this point in the history
Use Marcel::Magic.new(content_type).extensions instead of Marcel::TYPES[content_type]
  • Loading branch information
mshibuya committed Mar 2, 2024
1 parent 4c65b39 commit 78845ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/carrierwave/downloader/remote_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def headers

def original_filename
filename = filename_from_header || filename_from_uri
mime_type = Marcel::TYPES[content_type]
unless File.extname(filename).present? || mime_type.blank?
extension = mime_type[0].first
extensions = Marcel::Magic.new(content_type).extensions
unless File.extname(filename).present? || extensions.blank?
extension = extensions.first
filename = "#{filename}.#{extension}"
end
filename
Expand Down
2 changes: 1 addition & 1 deletion spec/processing/rmagick_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def foo=(value); raise; end
instance.manipulate! :read => {
:foo => "1"
}
end.to raise_error NoMethodError, /private method `foo=' called/
end.to raise_error NoMethodError, /private method .foo=. called/
end
end

Expand Down

0 comments on commit 78845ea

Please sign in to comment.