From 48adcda7499ee0ce8775c90a81238312ba3808a9 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 7 Jan 2020 12:54:27 +0800 Subject: [PATCH] add clear --- common/HttpClient.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/HttpClient.php b/common/HttpClient.php index 65d6dd2..60a71be 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -261,9 +261,11 @@ class HttpClient */ private function parseHost(&$url) { - $host = empty($this->host) ? $url : $this->host; - if ($this->checkIsIp($host)) { - return $host; + if (!empty($this->host)) { + $url = $this->host . '/' . ltrim($url, '/'); + } + if (strpos($url, 'http') === false) { + $url = 'https://' . $url; } $host = $this->cutRequestUrl($url); if ($this->checkIsIp($host)) {