Merge pull request #1444 from betagouv/cellar_monkey_patch_range
Disable content type detection for new attachments
This commit is contained in:
commit
d02ae00c0e
1 changed files with 9 additions and 0 deletions
9
config/initializers/monkey_patches.rb
Normal file
9
config/initializers/monkey_patches.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
ActiveStorage::Identification.class_eval do
|
||||||
|
def apply
|
||||||
|
# Monkey patch ActiveStorage to trust the user-submitted content type rather than determining
|
||||||
|
# it from the file contents, because Cellar does not seem to support the Range header
|
||||||
|
#
|
||||||
|
# FIXME : remove when better fix is available
|
||||||
|
blob.update!(content_type: declared_content_type, identified: true) unless blob.identified?
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue