From df413690953814d493b0d5637e8d917852df1605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 3 Apr 2020 17:29:43 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index 2cb429f..de9ff5d 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -410,8 +410,6 @@ class HttpClient $body = $client->body; - var_dump($body); - $header = $client->getHeaders(); $body = $this->resolve($header, $body); @@ -462,7 +460,12 @@ class HttpClient private function generate_client($host, $url, $data) { $client = new SClient($host, $this->getHostPort(), $this->isSSL); - $client->set($this->settings()); + + $settings = $this->settings(); + if (!empty($settings)) { + $client->set($this->settings()); + } + if (!empty($this->agent)) { $this->header['User-Agent'] = $this->agent; }