diff --git a/Router/Router.php b/Router/Router.php index 6e5b7a3..edf7c2f 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -20,8 +20,9 @@ class Router */ public function __construct(string $pathname) { - $this->uri = is_countable($_SERVER['REQUEST_URI']) && count($_SERVER['REQUEST_URI']) > 1 ? rtrim($_SERVER['REQUEST_URI'], "/") : $_SERVER['REQUEST_URI']; - $this->uri = str_replace($pathname, "", $this->uri); + $this->uri = str_replace($pathname, "", $_SERVER['REQUEST_URI']); + $this->uri = strlen($this->uri) > 1 ? rtrim($this->uri, "/") : $this->uri; + $this->requestType = $_SERVER['REQUEST_METHOD']; $this->routes = []; $this->middleware = [];