Fix route and redirect methods error when path not start with slash.

This commit is contained in:
KJ
2024-05-16 13:20:35 -04:00
parent 9a1e5a2379
commit a10308a8f6
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ class Router {
*/
public static function redirect(string $path): void
{
header('Location: '.static::basePath().substr($path,1));
header('Location: '.static::basePath().ltrim($path, '/'));
exit;
}