dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0771126
)
Fixed temp URL breakage in Swift
author
Aaron Schulz
<aschulz@wikimedia.org>
Fri, 10 Jan 2014 21:36:13 +0000
(13:36 -0800)
committer
Ori.livneh
<ori@wikimedia.org>
Mon, 13 Jan 2014 19:50:41 +0000
(19:50 +0000)
* The API behavior is not well-documented in that it wants the HMAC
to use the unencoded object name. CloudFiles had this same issue.
bug: 59894
Change-Id: I3f0c80eed55991bb85d0c12f98927efa19af6760
includes/filebackend/SwiftFileBackend.php
patch
|
blob
|
history
diff --git
a/includes/filebackend/SwiftFileBackend.php
b/includes/filebackend/SwiftFileBackend.php
index
91df61b
..
9ed6a45
100644
(file)
--- a/
includes/filebackend/SwiftFileBackend.php
+++ b/
includes/filebackend/SwiftFileBackend.php
@@
-1136,8
+1136,10
@@
class SwiftFileBackend extends FileBackendStore {
if ( $this->swiftTempUrlKey != '' ) {
$url = $this->storageUrl( $auth, $srcCont, $srcRel );
+ // Swift wants the signature based on the unencoded object name
+ $contPath = parse_url( $this->storageUrl( $auth, $srcCont ), PHP_URL_PATH );
$signature = hash_hmac( 'sha1',
- "GET\n{$expires}\n
" . parse_url( $url, PHP_URL_PATH )
,
+ "GET\n{$expires}\n
{$contPath}/{$srcRel}"
,
$this->swiftTempUrlKey
);
return "{$url}?temp_url_sig={$signature}&temp_url_expires={$expires}";