My Rails 4.2.5 app is receiving JPG uploads from a mobile app. However, the MIME Type in the headers is:
application/octet-stream
PaperClip 4.3.2 returns the following error:
[paperclip] Content Type Spoof: Filename 70221009989740.jpg (application/octet-stream from Headers, ...
I bypassed this issue using:
validate_media_type => false
and
do_not_validate_attachment_file_type
options.
However, this seems insecure. How can the media_type and file_type be correctly validated on MIME Type "application/octet-stream"?