Split response into headers and body based on the size of the headers cURL reports.
Fixes an issue with 100 Continue status codes, etc. where r\n\r\n appears within the list of headers.
This commit is contained in:
parent
8268daedfb
commit
dbd4ff96a5
|
|
@ -362,7 +362,9 @@ class Request extends Message implements RequestInterface
|
|||
$resp->statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
// Split the result into headers and body.
|
||||
list ($headers, $body) = explode("\r\n\r\n", $result, 2);
|
||||
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
|
||||
$headers = substr($result, 0, $headerSize);
|
||||
$body = substr($result, $headerSize);
|
||||
|
||||
// Set the body. Do not auto-add the Content-length header.
|
||||
$resp->setBody($body, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue