fixed HttpResponse (issue #13)
This commit is contained in:
@@ -62,13 +62,13 @@ class HttpResponse
|
|||||||
*/
|
*/
|
||||||
private function get_headers_from_curl_response($headers)
|
private function get_headers_from_curl_response($headers)
|
||||||
{
|
{
|
||||||
foreach (explode("\r\n", $headers) as $i => $line) {
|
$headers = explode("\r\n", $headers);
|
||||||
if ($i !== 0) {
|
array_shift($headers);
|
||||||
if (!empty($key) && substr($key, 0, 4) != "HTTP") {
|
|
||||||
$result[$key] = $value;
|
foreach ($headers as $line) {
|
||||||
} else {
|
if (strstr($line, ': ')) {
|
||||||
list ($key, $value) = explode(': ', $line);
|
list ($key, $value) = explode(': ', $line);
|
||||||
}
|
$result[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user