fixed HttpResponse (issue #13)

This commit is contained in:
Sam Sullivan
2013-06-19 15:26:14 -05:00
parent 5f4cc3ad16
commit a4ac5fb537

View File

@@ -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;
} }
} }