Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,7 @@ def compose_object(
size -= length
result = self._complete_multipart_upload(
bucket_name, object_name, upload_id, total_parts,
sse if isinstance(sse, SseCustomerKey) else None,
)
return ObjectWriteResult(
cast(str, result.bucket_name),
Expand Down Expand Up @@ -1732,6 +1733,7 @@ def _complete_multipart_upload(
object_name: str,
upload_id: str,
parts: list[Part],
ssec: Optional[SseCustomerKey] = None,
) -> CompleteMultipartUploadResult:
"""Execute CompleteMultipartUpload S3 API."""
element = Element("CompleteMultipartUpload")
Expand All @@ -1740,15 +1742,18 @@ def _complete_multipart_upload(
SubElement(tag, "PartNumber", str(part.part_number))
SubElement(tag, "ETag", '"' + part.etag + '"')
body = getbytes(element)
headers: DictType = {
"Content-Type": 'application/xml',
"Content-MD5": cast(str, md5sum_hash(body)),
}
if ssec:
headers.update(ssec.headers())
response = self._execute(
"POST",
bucket_name,
object_name,
body=body,
headers={
"Content-Type": 'application/xml',
"Content-MD5": cast(str, md5sum_hash(body)),
},
headers=headers,
query_params={'uploadId': upload_id},
)
return CompleteMultipartUploadResult(response)
Expand Down Expand Up @@ -1992,6 +1997,7 @@ def put_object(

upload_result = self._complete_multipart_upload(
bucket_name, object_name, cast(str, upload_id), parts,
sse if isinstance(sse, SseCustomerKey) else None,
)
return ObjectWriteResult(
cast(str, upload_result.bucket_name),
Expand Down