rackspace / php-opencloud

The PHP SDK for OpenStack clouds
developer.rackspace.com
Other
451 stars 250 forks source link

No way to pass headers to DataObject::copy() #755

Open syosoft opened 3 years ago

syosoft commented 3 years ago

Not sure how to do Pull Requests but need the ability to pass headers to copy() as the object headers are not copied.

rackspace/php-opencloud/lib/OpenCloud/ObjectStore/Resource/DataObject.php:368-382

/**
     * @param string $destination Path (`container/object') of new object
     * @return \Guzzle\Http\Message\Response
     */
    public function copy($destination, $headers = array())
    {
        $headers = array_merge(!is_array($headers) ? array() : array_filter($headers), array(
            'Destination' => (string) $destination,
        ));

        return $this->getService()
            ->getClient()
            ->createRequest('COPY', $this->getUrl(), $headers)
            ->send();
    }