diff options
author | Marcelo Perini Veloso <marcelo.perini.veloso@gmail.com> | 2018-09-05 00:21:44 -0300 |
---|---|---|
committer | Marcelo Perini Veloso <marcelo.perini.veloso@gmail.com> | 2018-09-06 20:04:21 -0300 |
commit | 0d4ba40688785ad65da1af36b3ad8efd8e14505e (patch) | |
tree | 01cad8807fa1c5534fe0b0f4297c182cdd9d2535 /activestorage/app | |
parent | 5bd4a4c78b43f25245d3597876f541d84782ecc7 (diff) | |
download | rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.tar.gz rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.tar.bz2 rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.zip |
Fix zero-byte files upload
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 |