From 19dce1394b79b092df8f389128c4db38b0d52235 Mon Sep 17 00:00:00 2001 From: Pierre MULLER Date: Thu, 24 Feb 2022 14:36:10 +0100 Subject: [PATCH] fix ExpectedBucketOwner argument mapping in head_object request during copy transfer --- s3transfer/copies.py | 2 +- tests/functional/test_copy.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/s3transfer/copies.py b/s3transfer/copies.py index a1dfdc8b..ab867fbc 100644 --- a/s3transfer/copies.py +++ b/s3transfer/copies.py @@ -39,7 +39,7 @@ class CopySubmissionTask(SubmissionTask): 'CopySourceSSECustomerAlgorithm': 'SSECustomerAlgorithm', 'CopySourceSSECustomerKeyMD5': 'SSECustomerKeyMD5', 'RequestPayer': 'RequestPayer', - 'ExpectedBucketOwner': 'ExpectedBucketOwner', + 'ExpectedSourceBucketOwner': 'ExpectedBucketOwner', } UPLOAD_PART_COPY_ARGS = [ diff --git a/tests/functional/test_copy.py b/tests/functional/test_copy.py index 86f05cbf..3ed892bc 100644 --- a/tests/functional/test_copy.py +++ b/tests/functional/test_copy.py @@ -227,6 +227,7 @@ def test_copy_with_extra_args(self): def test_copy_maps_extra_args_to_head_object(self): self.extra_args['CopySourceSSECustomerAlgorithm'] = 'AES256' + self.extra_args['ExpectedBucketOwner'] = 'expectedbucketowner' expected_head_params = { 'Bucket': 'mysourcebucket', @@ -238,6 +239,7 @@ def test_copy_maps_extra_args_to_head_object(self): 'Key': self.key, 'CopySource': self.copy_source, 'CopySourceSSECustomerAlgorithm': 'AES256', + 'ExpectedBucketOwner': 'expectedbucketowner', } self.add_head_object_response(expected_params=expected_head_params)