diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-11-15 08:24:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 08:24:06 +0100 |
commit | 830d85bcf1dd421717f69f3f22d434d1512e6e0f (patch) | |
tree | f564866f8332487b2e91e462fbe2d900ea37f213 /lib/private/Files | |
parent | 04a4a777ade8a4588d88d92133a9554e905ad58a (diff) | |
parent | cdf96fab924ee2cf244d081005340b943cc157c3 (diff) | |
download | nextcloud-server-830d85bcf1dd421717f69f3f22d434d1512e6e0f.tar.gz nextcloud-server-830d85bcf1dd421717f69f3f22d434d1512e6e0f.zip |
Merge pull request #41366 from ir0nhide/fix/multipart-copy-ssec
Diffstat (limited to 'lib/private/Files')
-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(); } |