Skip to content

Commit

Permalink
Merge pull request #1 from egesu/patch-1
Browse files Browse the repository at this point in the history
Do not try to parse response if status is 204
  • Loading branch information
leventcz authored May 30, 2024
2 parents c8d9b9b + 61f73a3 commit 5c1d676
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Http/GuzzleHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ private function tokenIsExpired(): bool
*/
private function parseResponse(ResponseInterface $response): array
{
if ($response->getStatusCode() === 204) {
return [];
}

try {
return (array) json_decode((string) $response->getBody(), true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
Expand Down

0 comments on commit 5c1d676

Please sign in to comment.