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; - } - - }