diff --git a/S3/S3.py b/S3/S3.py index ec90a775..d95c3ba8 100644 --- a/S3/S3.py +++ b/S3/S3.py @@ -11,6 +11,7 @@ ## -------------------------------------------------------------------- from __future__ import absolute_import, division +import base64 import sys import os @@ -1725,6 +1726,10 @@ def send_file(self, request, stream, labels, buffer = '', throttle = 0, sha256_hash = checksum_sha256_file(stream, offset, size_total) request.body = sha256_hash + # Provide the checksum with teh request. This is important for buckets that have + # Object Lock enabled. + headers['x-amz-checksum-sha256'] = base64.b64encode(sha256_hash.digest()).decode() + if use_expect_continue: if not size_total: use_expect_continue = False