From 7735ca5127259c24808d15a7d2b08171610b73bf Mon Sep 17 00:00:00 2001 From: James Seconde Date: Tue, 28 Feb 2023 15:45:33 +0000 Subject: [PATCH] Forgot to add return value to request (#380) * Forgot to add return value to request * Fix the basic query handler --- src/Client/Credentials/Handler/BasicQueryHandler.php | 4 +++- src/Entity/IterableAPICollection.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Client/Credentials/Handler/BasicQueryHandler.php b/src/Client/Credentials/Handler/BasicQueryHandler.php index 857ccffd..b75ba5b2 100644 --- a/src/Client/Credentials/Handler/BasicQueryHandler.php +++ b/src/Client/Credentials/Handler/BasicQueryHandler.php @@ -11,7 +11,9 @@ class BasicQueryHandler extends AbstractHandler public function __invoke(RequestInterface $request, CredentialsInterface $credentials): RequestInterface { $credentials = $this->extract(Basic::class, $credentials); + parse_str($request->getUri()->getQuery(), $query); + $query = array_merge($query, $credentials->asArray()); - return $request->withUri($request->getUri()->withQuery(http_build_query($credentials->asArray()))); + return $request->withUri($request->getUri()->withQuery(http_build_query($query))); } } \ No newline at end of file diff --git a/src/Entity/IterableAPICollection.php b/src/Entity/IterableAPICollection.php index 02211a46..28a5ce62 100644 --- a/src/Entity/IterableAPICollection.php +++ b/src/Entity/IterableAPICollection.php @@ -476,7 +476,7 @@ protected function fetchPage($absoluteUri): void $request = new Request($requestUri, 'GET'); if ($this->getApiResource()->getAuthHandler()) { - $this->getApiResource()->addAuth($request); + $request = $this->getApiResource()->addAuth($request); } $response = $this->client->send($request);