From 79b1e397988fb2f6a03762bfbb24c7fe1eb86381 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 1 May 2014 14:46:35 +0100 Subject: [PATCH] Removed special case for cURL --- src/ResourceServer.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/ResourceServer.php b/src/ResourceServer.php index f3723dbf..780da8d6 100644 --- a/src/ResourceServer.php +++ b/src/ResourceServer.php @@ -192,18 +192,7 @@ class ResourceServer extends AbstractServer public function determineAccessToken($headersOnly = false) { if ($header = $this->getRequest()->headers->get('Authorization')) { - // Check for special case, because cURL sometimes does an - // internal second request and doubles the authorization header, - // which always resulted in an error. - // - // 1st request: Authorization: Bearer XXX - // 2nd request: Authorization: Bearer XXX, Bearer XXX - if (strpos($header, ',') !== false) { - $headerPart = explode(',', $header); - $accessToken = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $headerPart[0])); - } else { - $accessToken = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $header)); - } + $accessToken = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $header)); $accessToken = ($accessToken === 'Bearer') ? '' : $accessToken; } elseif ($headersOnly === false) { $accessToken = $this->getRequest()->request->get($this->tokenKey);