diff --git a/src/Wuunder/Http/Request.php b/src/Wuunder/Http/Request.php index c923405..0066ba6 100644 --- a/src/Wuunder/Http/Request.php +++ b/src/Wuunder/Http/Request.php @@ -44,10 +44,10 @@ public function getResponseHeaders() { $headers = array(); - $header_text = substr($this->result, 0, strpos($this->result, "\r\n\r\n")); + $header_text = substr($this->result, 0, strrpos($this->result, "\r\n\r\n")); foreach (explode("\r\n", $header_text) as $i => $line) - if ($i === 0) + if (count($line) > 5 && substr($line, 0, 5) === "HTTPV") $headers['http_code'] = $line; else { diff --git a/tests/test.php b/tests/test.php index 0379cbc..a90663c 100644 --- a/tests/test.php +++ b/tests/test.php @@ -35,7 +35,7 @@ print("ParcelshopConfig not complete"); } -print("----------\r\n"); exit; +print("----------\r\n"); $parcelshopsRequest = $connector->getParcelshopsByAddress();