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

Add content from QueryString to build valide signature

Signed-off-by: Adrien Bensaibi <adrien.bensaibi@corp.ovh.com>
This commit is contained in:
Adrien Bensaibi 2016-01-19 13:10:44 +00:00
parent b472ebdec1
commit 727249f738
2 changed files with 10 additions and 1 deletions

View File

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