From 2ab9714f96efa87d22b0a848c72f3fc53f33e204 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 3 Jan 2020 15:15:00 +0800 Subject: [PATCH] add clear --- common/HttpClient.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/HttpClient.php b/common/HttpClient.php index f3d3238..a1837ce 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -482,7 +482,7 @@ class HttpClient if (is_array($body)) { return $body; } - $type = $data['Content-Type'] ?? $data['content-type']; + $type = $data['content-type']; if (strpos($type, 'text/html') !== false) { return $body; } else if (strpos($type, 'json') !== false) { @@ -502,12 +502,10 @@ class HttpClient private function headerFormat($headers) { $_tmp = []; - - var_dump($headers); foreach ($headers as $key => $val) { $trim = explode(': ', trim($val)); - $_tmp[$trim[0]] = $trim[1] ?? ''; + $_tmp[strtolower($trim[0])] = $trim[1] ?? ''; } var_dump($_tmp); return $_tmp;