This commit is contained in:
2023-08-17 16:32:02 +08:00
parent 18b44b32f2
commit c76fb40689
2 changed files with 8 additions and 7 deletions
+1 -7
View File
@@ -327,15 +327,9 @@ abstract class ClientAbstracts implements IClient
* @param string $host
* @return ClientAbstracts
*/
private function withHost(string $host): static
protected function withHost(string $host): static
{
$this->host = $host;
if (!preg_match('/(\d{1,3}\.){3}\d{1,3}/', $host)) {
if (class_exists(Coroutine::class) && Coroutine::getCid() > -1) {
$this->host = System::gethostbyname($host);
}
return $this->withAddedHeader('Host', $host);
}
return $this;
}