add clear

This commit is contained in:
as2252258@163.com
2019-12-19 10:51:57 +08:00
parent 2745650d39
commit dea36a9be5
+4 -6
View File
@@ -240,6 +240,9 @@ class HttpClient
*/
private function parseUrlHost(&$url)
{
if (!empty($this->host)) {
return $this->host;
}
if ($this->isHttp($url)) {
$url = str_replace('http://', '', $url);
} else if ($this->isHttps($url)) {
@@ -252,13 +255,8 @@ class HttpClient
if ($this->port !== 443) {
$this->isSSL = false;
}
$url = '/' . implode('/', $explode);
}
$url = '/' . implode('/', $explode);
if (!empty($this->host)) {
return $this->host;
}
if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $first)) {
return $first;
}