* 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
if ( $this->swiftTempUrlKey != '' ) {
$url = $this->storageUrl( $auth, $srcCont, $srcRel );
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',
$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}";
$this->swiftTempUrlKey
);
return "{$url}?temp_url_sig={$signature}&temp_url_expires={$expires}";