ソースを参照

Merge pull request #12779 from cakephp/curl-client-compat

Get just the header_size instead of all curl options
ADmad 7 年 前
コミット
c53429e805
1 ファイル変更3 行追加3 行削除
  1. 3 3
      src/Http/Client/Adapter/Curl.php

+ 3 - 3
src/Http/Client/Adapter/Curl.php

@@ -144,9 +144,9 @@ class Curl implements AdapterInterface
      */
     protected function createResponse($handle, $responseData)
     {
-        $meta = curl_getinfo($handle);
-        $headers = trim(substr($responseData, 0, $meta['header_size']));
-        $body = substr($responseData, $meta['header_size']);
+        $headerSize = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
+        $headers = trim(substr($responseData, 0, $headerSize));
+        $body = substr($responseData, $headerSize);
         $response = new Response(explode("\r\n", $headers), $body);
 
         return [$response];