TransferManager.upload doesn't retain bucketKeyEnabled
setting if using multipart upload
#3107
Open
1 task done
Upcoming End-of-Support
Describe the bug
If multipart upload is used, files uploaded by the
TransferManager
don't have the correct object-level bucket key setting as specified in thePutObjectRequest
.It turns out that the
bucketKeyEnabled
setting is not copied when configuring theInitiateMultipartUploadRequest
:aws-sdk-java/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java
Lines 422 to 430 in 34b4aa0
Expected Behavior
Objects uploaded by the
TransferManager
always have the correct object-level bucket key setting as specified in thePutObjectRequest
.Current Behavior
Objects uploaded by the
TransferManager
don't have the correct object-level bucket key setting as specified in thePutObjectRequest
when multipart upload is used.Reproduction Steps
TransferManager
with aMultipartUploadThreshold
of 8MB.TransferManager
with aMultipartUploadThreshold
of 16MB.PutObjectRequest
using the newTransferManager
.Possible Solution
Copy
bucketKeyEnabled
fromPutObjectRequest
toInitiateMultipartUploadRequest
, i.e. Add the following toUploadCallable.initiateMultipartUpload
:Additional Information/Context
No response
AWS Java SDK version used
1.12.466
JDK version used
openjdk version "17.0.9" 2023-10-17 LTS OpenJDK Runtime Environment Zulu17.46+19-CA (build 17.0.9+8-LTS) OpenJDK 64-Bit Server VM Zulu17.46+19-CA (build 17.0.9+8-LTS, mixed mode, sharing)
Operating System and version
macOS 13.6.3
The text was updated successfully, but these errors were encountered: