From 2ea3bd28c855f1b2ae69d5833bd4f34f6ebba0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 31 Mar 2020 14:59:18 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index db0755a..b4a996b 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -256,11 +256,8 @@ class HttpClient */ private function parseUrlHost(&$url) { - if (!empty($this->host)) { - $url = $this->host . '/' . ltrim($url, '/'); - } - if (strpos($url, 'http') === false) { - $url = 'https://' . $url; + if (!$this->isHttps($url) && !$this->isHttp($url)) { + $url = $this->host . '/' . $url; } $host = $this->cutRequestUrl($url); if ($this->checkIsIp($host)) {