1
0
mirror of https://github.com/ovh/php-ovh.git synced 2023-11-05 03:20:26 +01:00

Merge pull request #26 from Olinkl/AdrienBensaibi/fix_invalidsignature_by_querystring

Add content from QueryString into  to build signature
This commit is contained in:
Vincent Cassé 2016-01-21 17:01:36 +01:00
commit 43b0ba34e4
2 changed files with 10 additions and 1 deletions

View File

@ -232,7 +232,8 @@ class Api
$query = array_merge($query, (array)$content);
$query = \GuzzleHttp\Psr7\build_query($query);
$request = $request->withUri($request->getUri()->withQuery($query));
$url = $request->getUri()->withQuery($query);
$request = $request->withUri($url);
$body = "";
} elseif (isset($content)) {
$body = json_encode($content);

View File

@ -242,4 +242,12 @@ class ApiFunctionalTest extends \PHPUnit_Framework_TestCase
$this->api->get('/me/accessRestriction/ip', ['foo' => 'bar']);
}
/**
* Test Api::get, should build valide signature
*/
public function testApiGetWithQueryString()
{
$this->api->get('/me/api/credential', ['status' => 'pendingValidation']);
}
}