Skip to content

Commit cdf96fa

Browse files
committed
fix(s3): support SSE-C headers for the MultipartCopy call
Signed-off-by: Tobias Zimmerer <[email protected]>
1 parent 138ce53 commit cdf96fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/private/Files/ObjectStore/S3ObjectTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,20 @@ public function objectExists($urn) {
191191
}
192192

193193
public function copyObject($from, $to, array $options = []) {
194+
$sourceMetadata = $this->getConnection()->headObject([
195+
'Bucket' => $this->getBucket(),
196+
'Key' => $from,
197+
] + $this->getSSECParameters());
198+
194199
$copy = new MultipartCopy($this->getConnection(), [
195200
"source_bucket" => $this->getBucket(),
196201
"source_key" => $from
197202
], array_merge([
198203
"bucket" => $this->getBucket(),
199204
"key" => $to,
200205
"acl" => "private",
201-
"params" => $this->getSSECParameters() + $this->getSSECParameters(true)
206+
"params" => $this->getSSECParameters() + $this->getSSECParameters(true),
207+
"source_metadata" => $sourceMetadata
202208
], $options));
203209
$copy->copy();
204210
}

0 commit comments

Comments
 (0)