Skip to content

Commit

Permalink
Merge pull request #120 from myworkout/fix-headers-parsing
Browse files Browse the repository at this point in the history
Fix headers parsing of HttpClient
  • Loading branch information
maciejlew committed Mar 23, 2022
2 parents 615dc42 + 0924302 commit 613e62f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Curl/HttpClient.php
Expand Up @@ -88,7 +88,7 @@ private function execute(RequestInterface $request, $httpClient): ResponseInterf

$headerSize = curl_getinfo($httpClient, CURLINFO_HEADER_SIZE);
$headerString = substr($response, 0, $headerSize);
$headers = array_filter(explode("\n", $headerString), 'trim');
$headers = array_filter(array_map('trim', explode("\n", $headerString)));

$body = substr($response, $headerSize);

Expand All @@ -99,4 +99,4 @@ private function closeHttpClient($httpClient)
{
curl_close($httpClient);
}
}
}

0 comments on commit 613e62f

Please sign in to comment.