]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(s3): support SSE-C headers for the MultipartCopy call 41366/head
authorTobias Zimmerer <3228193+ir0nhide@users.noreply.github.com>
Thu, 9 Nov 2023 18:03:30 +0000 (19:03 +0100)
committerTobias Zimmerer <3228193+ir0nhide@users.noreply.github.com>
Tue, 14 Nov 2023 20:19:59 +0000 (21:19 +0100)
Signed-off-by: Tobias Zimmerer <3228193+ir0nhide@users.noreply.github.com>
lib/private/Files/ObjectStore/S3ObjectTrait.php

index e9c52f11936bcceff7c6ba000fbd375766be026e..217e1a1a2ff7e05421187dc05b7d81cfa4901809 100644 (file)
@@ -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();
        }