From c8bfd4e1c5eb82775f7ca1a2be96ef660848ffc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 11 Jan 2021 18:43:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Client/Result.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/HttpServer/Client/Result.php b/HttpServer/Client/Result.php index bd763637..4a258d11 100644 --- a/HttpServer/Client/Result.php +++ b/HttpServer/Client/Result.php @@ -85,14 +85,17 @@ class Result if (!is_array($this->header)) { return $_tmp; } - var_dump($this->header); foreach ($this->header as $key => $val) { if ($key == 0) { $_tmp['pro'] = $val; } else { - $trim = explode(': ', $val); + if (str_contains($val, ': ')) { + $trim = explode(': ', $val); - $_tmp[strtolower($trim[0])] = $trim[1]; + $_tmp[strtolower($trim[0])] = $trim[1]; + } else { + $_tmp[$key] = $val; + } } } return $_tmp;