From 714dc328a84a0c98c6f9c362db8ac8bac3b6b080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 24 Apr 2023 11:42:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Handler/OnRequest.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 79ebccd..978db20 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -84,14 +84,8 @@ class OnRequest implements OnRequestInterface $uri = new Uri(); $uri->withQuery($request->server['query_string'] ?? '') ->withPath($request->server['path_info']) + ->withHost($request->header['host'] ?? '127.0.0.1') ->withPort($request->server['server_port']); - $host = $request->header['host'] ?? '127.0.0.1'; - if (str_contains($host, ':')) { - [$host, $port] = explode(':', $host); - $uri->withHost($host)->withPort((int)$port); - } else { - $uri->withHost($host); - } if (isset($request->server['https']) && $request->server['https'] !== 'off') { $uri->withScheme('https'); } else {