diff options
Diffstat (limited to 'src/Server/RequestHandlers')
-rw-r--r-- | src/Server/RequestHandlers/DocumentServer.php | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Server/RequestHandlers/DocumentServer.php b/src/Server/RequestHandlers/DocumentServer.php index e55a891..0b1f2ae 100644 --- a/src/Server/RequestHandlers/DocumentServer.php +++ b/src/Server/RequestHandlers/DocumentServer.php @@ -27,7 +27,7 @@ class DocumentServer implements RequestHandlerInterface public function __invoke(Response $response, Request $request): Response { - $requestPath = $this->trim(urldecode($request->getPath())); + $requestPath = rtrim(urldecode($request->getPath()), '/'); $filePath = $this->documentRoot . $requestPath; $documentPath = $filePath; @@ -57,9 +57,4 @@ class DocumentServer implements RequestHandlerInterface return $response; } - - private function trim(string $string) - { - return str_ends_with($string, '/') ? substr($string, offset: 0, length: -1) : $string; - } } |