diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/active_storage/service/gcs_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/active_storage/service/gcs_service.rb b/lib/active_storage/service/gcs_service.rb index a558791d89..532da08df3 100644 --- a/lib/active_storage/service/gcs_service.rb +++ b/lib/active_storage/service/gcs_service.rb @@ -10,8 +10,11 @@ class ActiveStorage::Service::GCSService < ActiveStorage::Service end def upload(key, io, checksum: nil) - # FIXME: Ensure integrity by sending the checksum for service side verification - bucket.create_file(io, key) + begin + bucket.create_file(io, key, md5: checksum) + rescue Google::Cloud::InvalidArgumentError + raise ActiveStorage::IntegrityError + end end # FIXME: Add streaming when given a block |