From 404c35759db45b862584075cbf9e01de07fd6e85 Mon Sep 17 00:00:00 2001 From: DanMan Date: Thu, 12 May 2022 17:41:53 +0200 Subject: [PATCH] Provide all available cURL info as metadata --- src/OAuth2/Client.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/OAuth2/Client.php b/src/OAuth2/Client.php index 3b27bed..335ebba 100644 --- a/src/OAuth2/Client.php +++ b/src/OAuth2/Client.php @@ -467,8 +467,7 @@ private function executeRequest($url, $parameters = array(), $http_method = self curl_setopt_array($ch, $this->curl_options); } $result = curl_exec($ch); - $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); + $curl_info = curl_getinfo($ch); if ($curl_error = curl_error($ch)) { throw new Exception($curl_error, Exception::CURL_ERROR); } else { @@ -478,8 +477,7 @@ private function executeRequest($url, $parameters = array(), $http_method = self return array( 'result' => (null === $json_decode) ? $result : $json_decode, - 'code' => $http_code, - 'content_type' => $content_type + 'meta' => $curl_info ); }