add clear

This commit is contained in:
as2252258@163.com
2019-12-19 10:41:42 +08:00
parent b6690c18d5
commit 7c849555f4
+6 -3
View File
@@ -247,10 +247,13 @@ class HttpClient
}
$explode = explode('/', $url);
$first = array_shift($explode);
if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $first)) {
if (strpos($first, ':') !== false) {
[$first, $this->port] = explode(':', $first);
if (strpos($first, ':') !== false) {
[$first, $this->port] = explode(':', $first);
if ($this->port !== 443) {
$this->isSSL = false;
}
}
if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $first)) {
return $first;
}
return System::gethostbyname($first);