Open
Description
I have a valid ZIP archive that happens to include the bytes wmv2
in the first four kilobytes. Active Storage misidentifies the file as Windows Media Video. When scanning over such a broad range of bytes, WMV magic needs a lower priority than other matches.
Marcel::MimeType.for Pathname.new('A-453.zip'), name: 'A-453.zip', declared_type: 'application/zip'
# => "video/x-ms-wmv"
File.read('A-453.zip')[0...4]
# => "PK\u0003\u0004"
File.read('A-453.zip').index('wmv2')
# => 585
`unzip -t A-453.zip`.chomp.split("\n").last
# => "No errors detected in compressed data of A-453.zip."
Metadata
Metadata
Assignees
Labels
No labels