aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app
diff options
context:
space:
mode:
authorMarcelo Perini Veloso <marcelo.perini.veloso@gmail.com>2018-09-05 00:21:44 -0300
committerMarcelo Perini Veloso <marcelo.perini.veloso@gmail.com>2018-09-06 20:04:21 -0300
commit0d4ba40688785ad65da1af36b3ad8efd8e14505e (patch)
tree01cad8807fa1c5534fe0b0f4297c182cdd9d2535 /activestorage/app
parent5bd4a4c78b43f25245d3597876f541d84782ecc7 (diff)
downloadrails-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.rb6
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