From 6cfb697ff760381a62580fd9a1243e425f45bc5c Mon Sep 17 00:00:00 2001 From: Sean Benoit Date: Wed, 21 Apr 2021 16:13:11 -0400 Subject: [PATCH] Update DataObject::copy() to allow for $headers argument. The 'COPY' action does not appear to copy object headers. The ability to pass in object headers is necessary. --- lib/OpenCloud/ObjectStore/Resource/DataObject.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OpenCloud/ObjectStore/Resource/DataObject.php b/lib/OpenCloud/ObjectStore/Resource/DataObject.php index 5eb3c085e..a041d9043 100644 --- a/lib/OpenCloud/ObjectStore/Resource/DataObject.php +++ b/lib/OpenCloud/ObjectStore/Resource/DataObject.php @@ -369,13 +369,13 @@ public function update($params = array()) * @param string $destination Path (`container/object') of new object * @return \Guzzle\Http\Message\Response */ - public function copy($destination) + public function copy($destination, array $headers = array()) { + $headers = array_merge($headers, array('Destination' => (string) $destination)); + return $this->getService() ->getClient() - ->createRequest('COPY', $this->getUrl(), array( - 'Destination' => (string) $destination - )) + ->createRequest('COPY', $this->getUrl(), $headers) ->send(); }