From fd61b6f1d91740cbcda4013933791526072ae7ca Mon Sep 17 00:00:00 2001 From: xl Date: Tue, 7 Nov 2023 16:16:34 +0800 Subject: [PATCH] eee --- CoroutineClient.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CoroutineClient.php b/CoroutineClient.php index 826e73d..4a9e244 100644 --- a/CoroutineClient.php +++ b/CoroutineClient.php @@ -34,11 +34,16 @@ class CoroutineClient extends ClientAbstracts if (!str_starts_with($path, '/')) { $path = '/' . $path; } + + $host = $this->getHost(); + if (!preg_match('/(\d{1,3}\.){3}\d{1,3}/', $host)) { + $this->withAddedHeader('Host', $host); + } $this->withMethod($method) - ->coroutine( - $path, - $this->paramEncode($params) - ); + ->coroutine( + $path, + $this->paramEncode($params) + ); }