diff options
author | Tobias Zimmerer <3228193+ir0nhide@users.noreply.github.com> | 2023-11-09 19:03:30 +0100 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-11-15 07:37:09 +0000 |
commit | 8970f96e3b64cab028a57dcfb10f7f88951c9e2f (patch) | |
tree | 2296e9c3aa9073cadcd4e8f64a15b025b9bd6eec /lib | |
parent | 5c91f2de2419628819e9bcdf4d84c2db0c099745 (diff) | |
download | nextcloud-server-8970f96e3b64cab028a57dcfb10f7f88951c9e2f.tar.gz nextcloud-server-8970f96e3b64cab028a57dcfb10f7f88951c9e2f.zip |
fix(s3): support SSE-C headers for the MultipartCopy call
Signed-off-by: Tobias Zimmerer <3228193+ir0nhide@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 8 |
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(); } |