add clear
This commit is contained in:
@@ -125,7 +125,11 @@ class HttpClient
|
|||||||
*/
|
*/
|
||||||
public function setHost(string $host)
|
public function setHost(string $host)
|
||||||
{
|
{
|
||||||
$this->host = $host;
|
$this->host = $this->replaceHost($host);
|
||||||
|
$match_quest = '/^[a-zA-Z\-](\.[a-zA-Z\-])*/';
|
||||||
|
if (preg_match($match_quest, $this->host)) {
|
||||||
|
$this->addHeader('Host', $this->host);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -262,7 +266,6 @@ class HttpClient
|
|||||||
if ($this->checkIsIp($host)) {
|
if ($this->checkIsIp($host)) {
|
||||||
return $host;
|
return $host;
|
||||||
}
|
}
|
||||||
$this->addHeader('Host', $host);
|
|
||||||
return System::gethostbyname($host);
|
return System::gethostbyname($host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user