From 35d18df5ef83cfc9d31c0126c5cf393f900e572a Mon Sep 17 00:00:00 2001 From: Menno Holtkamp Date: Thu, 4 Apr 2024 22:05:24 +0200 Subject: [PATCH] Respect that headers are returned as array --- src/Picqer/Financials/Moneybird/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Picqer/Financials/Moneybird/Connection.php b/src/Picqer/Financials/Moneybird/Connection.php index 833964a..38f7e6c 100644 --- a/src/Picqer/Financials/Moneybird/Connection.php +++ b/src/Picqer/Financials/Moneybird/Connection.php @@ -545,8 +545,8 @@ private function checkWhetherRateLimitHasBeenReached(ResponseInterface $response if ($response->getStatusCode() === 429 && count($rateLimitRemainingHeaders) > 0) { $exception = new TooManyRequestsException('Error ' . $response->getStatusCode() . ': ' . $errorMessage, $response->getStatusCode()); $exception->retryAfterNumberOfSeconds = (int) current($rateLimitRemainingHeaders); - $exception->currentRateLimit = (int) $response->getHeader('RateLimit-Limit'); - $exception->rateLimitResetsAfterTimestamp = (int) $response->getHeader('RateLimit-Reset'); + $exception->currentRateLimit = (int) current($response->getHeader('RateLimit-Limit')); + $exception->rateLimitResetsAfterTimestamp = (int) current($response->getHeader('RateLimit-Reset')); throw $exception; }