Skip to content

Commit 3dee6ea

Browse files
author
Jamie Hannaford
committed
Merge pull request #209 from davidscholberg/working
Fixed HMAC body for temp URL generation
2 parents 5b14138 + 1d54969 commit 3dee6ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/OpenCloud/ObjectStore/Resource/DataObject.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)