diff --git a/HttpServer/Http/HttpHeaders.php b/HttpServer/Http/HttpHeaders.php index edaa8d85..9146b5ec 100644 --- a/HttpServer/Http/HttpHeaders.php +++ b/HttpServer/Http/HttpHeaders.php @@ -59,7 +59,11 @@ class HttpHeaders */ public function getRequestUri(): ?string { - return $this->__handler__('request_uri'); + $uri = $this->__handler__('request_uri', '/'); + if (empty($uri)) { + return '/'; + } + return $uri; } diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index e99367d7..0cf762c4 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace HttpServer\Route; -use Annotation\Route\Route; use Closure; use Exception; use HttpServer\Abstracts\HttpService; @@ -481,32 +480,6 @@ class Router extends HttpService implements RouterInterface } - /** - * @return mixed - * @throws - */ - public function dispatch(Request $request): void - { - $node = $this->find_path($request); - if (!($node instanceof Node)) { - $this->response->setFormat(Response::HTML); - $this->response->send('