diff --git a/src/Api.php b/src/Api.php index 9179113..a8e254f 100644 --- a/src/Api.php +++ b/src/Api.php @@ -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); diff --git a/tests/ApiFunctionalTest.php b/tests/ApiFunctionalTest.php index 651dd8c..85a1f1b 100644 --- a/tests/ApiFunctionalTest.php +++ b/tests/ApiFunctionalTest.php @@ -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']); + } }