Skip to content

Commit 6cfb697

Browse files
authored
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.
1 parent ea17eff commit 6cfb697

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/OpenCloud/ObjectStore/Resource/DataObject.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,13 @@ public function update($params = array())
369369
* @param string $destination Path (`container/object') of new object
370370
* @return \Guzzle\Http\Message\Response
371371
*/
372-
public function copy($destination)
372+
public function copy($destination, array $headers = array())
373373
{
374+
$headers = array_merge($headers, array('Destination' => (string) $destination));
375+
374376
return $this->getService()
375377
->getClient()
376-
->createRequest('COPY', $this->getUrl(), array(
377-
'Destination' => (string) $destination
378-
))
378+
->createRequest('COPY', $this->getUrl(), $headers)
379379
->send();
380380
}
381381

0 commit comments

Comments
 (0)