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;