diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-11 17:56:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 17:56:29 -0400 |
commit | e9ae7a1514d660fee8cacc6a9aa7524f6f4617e3 (patch) | |
tree | 3cd40e9cb322693bbcf09fcfc575d18ef427fb92 /activestorage/app | |
parent | ab0eed599b9cb2b62eab79ae761464ea732b2e70 (diff) | |
parent | 0d4ba40688785ad65da1af36b3ad8efd8e14505e (diff) | |
download | rails-e9ae7a1514d660fee8cacc6a9aa7524f6f4617e3.tar.gz rails-e9ae7a1514d660fee8cacc6a9aa7524f6f4617e3.tar.bz2 rails-e9ae7a1514d660fee8cacc6a9aa7524f6f4617e3.zip |
Merge pull request #33795 from marceloperini/marceloperini/33450-active-storage
Fix zero-byte files upload in #33630
Diffstat (limited to 'activestorage/app')
-rw-r--r-- | activestorage/app/models/active_storage/blob/identifiable.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activestorage/app/models/active_storage/blob/identifiable.rb b/activestorage/app/models/active_storage/blob/identifiable.rb index 049e45dc3e..2c17ddc25f 100644 --- a/activestorage/app/models/active_storage/blob/identifiable.rb +++ b/activestorage/app/models/active_storage/blob/identifiable.rb @@ -15,6 +15,10 @@ module ActiveStorage::Blob::Identifiable end def download_identifiable_chunk - service.download_chunk key, 0...4.kilobytes + if byte_size.positive? + service.download_chunk key, 0...4.kilobytes + else + "" + end end end |