From 57337cbe160b287c48a047154c37504adc3c8146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 18 Aug 2023 16:37:47 +0800 Subject: [PATCH] qqq --- ClientAbstracts.php | 4 ---- CoroutineClient.php | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ClientAbstracts.php b/ClientAbstracts.php index 7dbd55f..7614b68 100644 --- a/ClientAbstracts.php +++ b/ClientAbstracts.php @@ -331,10 +331,6 @@ abstract class ClientAbstracts implements IClient protected function withHost(string $host): static { $this->host = $host; - if (Context::inCoroutine() && !preg_match('/(\d{1,3}\.){3}\d{1,3}/', $host)) { - $this->host = System::gethostbyname($host); - $this->withAddedHeader('Host', $host); - } return $this; } diff --git a/CoroutineClient.php b/CoroutineClient.php index 397d9c0..1fd7d6c 100644 --- a/CoroutineClient.php +++ b/CoroutineClient.php @@ -37,8 +37,7 @@ class CoroutineClient extends ClientAbstracts } $host = $this->getHost(); if (!preg_match('/(\d{1,3}\.){3}\d{1,3}/', $host)) { - $this->withHost(System::gethostbyname($host)); - $this->withAddedHeader('Host', $host); + $this->withHost(System::gethostbyname($host))->withAddedHeader('Host', $host); } $this->withMethod($method) ->coroutine(