Merge pull request #1 from sanderaido/trailing-slash

Remove trailing slash from routes
This commit is contained in:
Sander A 2019-01-31 03:27:11 +02:00 committed by GitHub
commit 642f9b8edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,8 +27,8 @@ class Route{
// Parse current url
$parsed_url = parse_url($_SERVER['REQUEST_URI']);//Parse Uri
if(isset($parsed_url['path'])){
$path = $parsed_url['path'];
if(isset($parsed_url['path']) && $parsed_url['path'] != '/'){
$path = rtrim($parsed_url['path'], '/');
}else{
$path = '/';
}