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
fix(s3): Pass SSE-C parameters for multipart upload
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and backportbot-nextcloud[bot] committed Jul 20, 2023
commit e25db0e2947adf242cacda23d9b4b6813814023d
10 changes: 5 additions & 5 deletions lib/private/Files/ObjectStore/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function initiateMultipartUpload(string $urn): string {
$upload = $this->getConnection()->createMultipartUpload([
'Bucket' => $this->bucket,
'Key' => $urn,
]);
] + $this->getSSECParameters());
$uploadId = $upload->get('UploadId');
if ($uploadId === null) {
throw new Exception('No upload id returned');
Expand All @@ -65,7 +65,7 @@ public function uploadMultipartPart(string $urn, string $uploadId, int $partId,
'ContentLength' => $size,
'PartNumber' => $partId,
'UploadId' => $uploadId,
]);
] + $this->getSSECParameters());
}

public function getMultipartUploads(string $urn, string $uploadId): array {
Expand All @@ -80,12 +80,12 @@ public function getMultipartUploads(string $urn, string $uploadId): array {
'UploadId' => $uploadId,
'MaxParts' => 1000,
'PartNumberMarker' => $partNumberMarker
]);
] + $this->getSSECParameters());
$parts = array_merge($parts, $result->get('Parts') ?? []);
$isTruncated = $result->get('IsTruncated');
$partNumberMarker = $result->get('NextPartNumberMarker');
}

return $parts;
}

Expand All @@ -95,7 +95,7 @@ public function completeMultipartUpload(string $urn, string $uploadId, array $re
'Key' => $urn,
'UploadId' => $uploadId,
'MultipartUpload' => ['Parts' => $result],
]);
] + $this->getSSECParameters());
$stat = $this->getConnection()->headObject([
'Bucket' => $this->bucket,
'Key' => $urn,
Expand Down