From 26b40f2efd10e60ea82e26562026f1931b2afb1b Mon Sep 17 00:00:00 2001 From: Timo Janssrn Date: Mon, 23 Jul 2018 13:22:41 +0200 Subject: [PATCH] bugfix headerreader --- src/Wuunder/Http/Request.php | 4 ++-- tests/test.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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();