Skip to content

Commit 1c976f0

Browse files
Merge branch 'working'
2 parents b97ca23 + 3dee6ea commit 1c976f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/OpenCloud/ObjectStore/Resource/DataObject.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DataObject extends AbstractResource
4343
public function __construct(Container $container, $data = null)
4444
{
4545
$this->setContainer($container);
46-
$this->setService($container->getService());
46+
parent::__construct($container->getService());
4747

4848
// For pseudo-directories, we need to ensure the name is set
4949
if (!empty($data->subdir)) {
@@ -169,7 +169,8 @@ public function getTemporaryUrl($expires, $method)
169169
// @codeCoverageIgnoreEnd
170170

171171
$url = $this->getUrl();
172-
$body = sprintf("%s\n%d\n%s", $method, $expiry, $url->getPath());
172+
$urlPath = urldecode($url->getPath());
173+
$body = sprintf("%s\n%d\n%s", $method, $expiry, $urlPath);
173174
$hash = hash_hmac('sha1', $body, $secret);
174175

175176
return sprintf('%s?temp_url_sig=%s&temp_url_expires=%d', $url, $hash, $expiry);
@@ -223,4 +224,4 @@ public function refresh()
223224
$this->setContentType((string) $response->getHeader('Content-Type'));
224225
}
225226

226-
}
227+
}

0 commit comments

Comments
 (0)