Browse Source

Fix mimetype returning nil (#14356)

main
Takeshi Umeda 2 years ago
committed by GitHub
parent
commit
101485a41f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/paperclip/media_type_spoof_detector_extensions.rb

2
lib/paperclip/media_type_spoof_detector_extensions.rb

@ -18,7 +18,7 @@ module Paperclip
@type_from_mime_magic ||= begin
begin
File.open(@file.path) do |file|
MimeMagic.by_magic(file)&.type
MimeMagic.by_magic(file)&.type || ''
end
rescue Errno::ENOENT
''

Loading…
Cancel
Save