diff options
author | Graham Conzett <gconzett@orangebarrelmedia.com> | 2018-10-07 15:22:58 -0400 |
---|---|---|
committer | Graham Conzett <gconzett@orangebarrelmedia.com> | 2018-10-07 16:07:09 -0400 |
commit | 1986048d27383b0e70264583e8b6922652d6e5c4 (patch) | |
tree | afbb5705df72567f6fc157f8804e86a908f1a377 /activestorage/app | |
parent | 4429540995b061cf120b6468ce76cbb44fcaba9c (diff) | |
download | rails-1986048d27383b0e70264583e8b6922652d6e5c4.tar.gz rails-1986048d27383b0e70264583e8b6922652d6e5c4.tar.bz2 rails-1986048d27383b0e70264583e8b6922652d6e5c4.zip |
Fix issue ActiveStorage direct upload disk
Fix an issue in ActiveStorage where a direct upload to disk storage
would fail due to a content type mismatch if the file was uploaded using
a mime-type synonym.
Diffstat (limited to 'activestorage/app')
-rw-r--r-- | activestorage/app/controllers/active_storage/disk_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activestorage/app/controllers/active_storage/disk_controller.rb b/activestorage/app/controllers/active_storage/disk_controller.rb index 7bd641ab9a..652084e822 100644 --- a/activestorage/app/controllers/active_storage/disk_controller.rb +++ b/activestorage/app/controllers/active_storage/disk_controller.rb @@ -61,6 +61,7 @@ class ActiveStorage::DiskController < ActiveStorage::BaseController end def acceptable_content?(token) - token[:content_type] == request.content_type && token[:content_length] == request.content_length + Mime::Type.lookup(request.content_type) == token[:content_type] && + token[:content_length] == request.content_length end end |