diff --git a/VERSION b/VERSION index 3a246b1..e037e50 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2309.111925 +0.2309.111944 diff --git a/src/Http/HttpRequest.php b/src/Http/HttpRequest.php index 319c1c7..7ffb165 100644 --- a/src/Http/HttpRequest.php +++ b/src/Http/HttpRequest.php @@ -1,11 +1,12 @@ setHttpVersion(new Version(...array_map('intval', explode('.', substr($_SERVER['SERVER_PROTOCOL'], 5))))); $build->setMethod($_SERVER['REQUEST_METHOD']); - $build->setPath(parse_url('/' . trim($_SERVER['REQUEST_URI'], '/'), PHP_URL_PATH)); + + // this currently doesn't "properly" support the scenario where a full url is specified in the http request + $path = $_SERVER['REQUEST_URI']; + $pathQueryOffset = strpos($path, '?'); + if($pathQueryOffset !== false) + $path = substr($path, 0, $pathQueryOffset); + else { + $pathHashOffset = strpos($path, '#'); + if($pathHashOffset !== false) + $path = substr($path, 0, $pathHashOffset); + } + + if(!str_starts_with($path, '/')) + $path = '/' . $path; + + $build->setPath($path); $build->setParams($_GET); $build->setCookies($_COOKIE);