Skip to content

Commit

Permalink
Send checksum to S3 to verify file integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
John Williams committed Jul 6, 2017
1 parent 1378bbf commit f853916
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/active_storage/service/s3_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def initialize(access_key_id:, secret_access_key:, region:, bucket:)
end

def upload(key, io, checksum: nil)
# FIXME: Ensure integrity by sending the checksum for service side verification
object_for(key).put(body: io)
object_for(key).put(body: io, content_md5: checksum)
end

def download(key)
Expand Down

0 comments on commit f853916

Please sign in to comment.