This commit is contained in:
2020-11-14 03:03:41 +08:00
parent b556ebffa2
commit 8319fac4b7
+4 -1
View File
@@ -363,6 +363,10 @@ class HttpClient
[$this->host, $this->port] = explode(':', $this->host);
}
if ($this->use_swoole) {
return $string;
}
if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) {
$this->host = System::gethostbyname($this->host);
}
@@ -525,7 +529,6 @@ class HttpClient
$this->header['User-Agent'] = $this->agent;
}
if (!empty($this->header)) {
var_dump($this->header);
$client->setHeaders($this->header);
}
$client->setMethod(strtoupper($this->method));