diff --git a/src/AccessToken.php b/src/AccessToken.php index 1f4fe40da..0afc4ca1e 100644 --- a/src/AccessToken.php +++ b/src/AccessToken.php @@ -372,10 +372,10 @@ private function retrieveCertsFromLocation($url, array $options = []) if ($cacheControl = $response->getHeaderLine('Cache-Control')) { array_map(function ($value) use (&$expireTime) { list($key, $value) = explode('=', $value) + [null, null]; - if ($key == 'max-age') { + if (trim($key) == 'max-age') { $expireTime = '+' . $value . ' seconds'; } - }, explode(', ', $cacheControl)); + }, explode(',', $cacheControl)); } return [ json_decode((string) $response->getBody(), true),