summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2023-11-16 00:20:32 +0100
committerGitHub <noreply@github.com>2023-11-16 00:20:32 +0100
commit26e24dc909bdaaa60265e3cf005a86d8c157f906 (patch)
tree1f513642332104a7001c072043d1c567cbdbe899
parentf3e95bf05a708330e43c3106f1cf9817e64372bf (diff)
parent8970f96e3b64cab028a57dcfb10f7f88951c9e2f (diff)
downloadnextcloud-server-26e24dc909bdaaa60265e3cf005a86d8c157f906.tar.gz
nextcloud-server-26e24dc909bdaaa60265e3cf005a86d8c157f906.zip
Merge pull request #41482 from nextcloud/backport/41366/stable27
[stable27] fix(s3): support SSE-C headers for the MultipartCopy call
-rw-r--r--lib/private/Files/ObjectStore/S3ObjectTrait.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php
index e9c52f11936..217e1a1a2ff 100644
--- a/lib/private/Files/ObjectStore/S3ObjectTrait.php
+++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php
@@ -191,6 +191,11 @@ trait S3ObjectTrait {
}
public function copyObject($from, $to, array $options = []) {
+ $sourceMetadata = $this->getConnection()->headObject([
+ 'Bucket' => $this->getBucket(),
+ 'Key' => $from,
+ ] + $this->getSSECParameters());
+
$copy = new MultipartCopy($this->getConnection(), [
"source_bucket" => $this->getBucket(),
"source_key" => $from
@@ -198,7 +203,8 @@ trait S3ObjectTrait {
"bucket" => $this->getBucket(),
"key" => $to,
"acl" => "private",
- "params" => $this->getSSECParameters() + $this->getSSECParameters(true)
+ "params" => $this->getSSECParameters() + $this->getSSECParameters(true),
+ "source_metadata" => $sourceMetadata
], $options));
$copy->copy();
}