From 07e651d2afa9598e2450b6a024c28bbbcc16a8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 26 Jul 2023 09:58:34 +0800 Subject: [PATCH] qqq --- Handler/OnRequest.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index ae697fd..c895719 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -119,7 +119,7 @@ class OnRequest implements OnRequestInterface $PsrResponse->withContentType($this->response->contentType); $serverRequest = (new ConstrictRequest())->withDataHeaders($request->getData()) - ->withUri(static::parse($request)) + ->withUri(new Uri($request->server)) ->withProtocolVersion($request->server['server_protocol']) ->withCookieParams($request->cookie ?? []) ->withServerParams($request->server) @@ -133,24 +133,4 @@ class OnRequest implements OnRequestInterface } - /** - * @param Request $request - * @return UriInterface - */ - public static function parse(Request $request): UriInterface - { - $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']); - if (isset($request->server['https']) && $request->server['https'] !== 'off') { - $uri->withScheme('https'); - } else { - $uri->withScheme('http'); - } - return $uri; - } - - }