add clear

This commit is contained in:
2020-09-24 11:43:22 +08:00
parent 465e48ffe4
commit b5a8102b72
+1 -2
View File
@@ -171,6 +171,7 @@ class HttpClient
public function setHost(string $host)
{
$this->host = $this->replaceHost($host);
var_dump($this->host);
$match_quest = '/^[a-zA-Z\-]+(\.[a-zA-Z\-])+/';
if (preg_match($match_quest, $this->host)) {
$this->addHeader('Host', $this->host);
@@ -316,11 +317,9 @@ class HttpClient
if (empty($string)) {
return false;
}
if (!empty($this->host)) {
return $string;
}
var_dump($this->host,$string);
if ($this->isHttp($string)) {
$string = str_replace('http://', '', $string);
$hostAndUrls = explode('/', $string);