改名
This commit is contained in:
@@ -8,7 +8,6 @@ use Closure;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
use Snowflake\Core\Help;
|
use Snowflake\Core\Help;
|
||||||
use Swoole\Coroutine;
|
|
||||||
use Swoole\Coroutine\System;
|
use Swoole\Coroutine\System;
|
||||||
|
|
||||||
|
|
||||||
@@ -182,12 +181,12 @@ abstract class ClientAbstracts extends Component implements IClient
|
|||||||
*/
|
*/
|
||||||
public function setHost(string $host): void
|
public function setHost(string $host): void
|
||||||
{
|
{
|
||||||
$this->host = $host;
|
if (!preg_match('/(\d{1,3}\.){4}/', $host . '.')) {
|
||||||
// if (!preg_match('/(\d{1,3}\.){4}/', $host . '.')) {
|
$this->addHeader('Host', $host);
|
||||||
// $this->addHeader('Host', $host);
|
$this->host = System::gethostbyname($host);
|
||||||
// $this->host = System::gethostbyname($host);
|
} else {
|
||||||
// } else {
|
$this->host = $host;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -723,7 +722,7 @@ abstract class ClientAbstracts extends Component implements IClient
|
|||||||
}
|
}
|
||||||
if (isIp($domain)) {
|
if (isIp($domain)) {
|
||||||
$this->host = $domain;
|
$this->host = $domain;
|
||||||
} else if ($this->use_swoole) {
|
} else {
|
||||||
$this->host = System::gethostbyname($domain) ?? $domain;
|
$this->host = System::gethostbyname($domain) ?? $domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user