Skip to content

Commit 87fcb7b

Browse files
committed
fix: filter out real middleware from rogues in stack
1 parent 5815717 commit 87fcb7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ private static function handle(?array $routes = null, bool $quitAfterRun = false
824824

825825
// hacky solution to handle middleware catching all middleware with pattern (.*?)
826826
$routesToRun = array_filter($routeToHandle, function ($route) use ($uri) {
827-
return $route['route']['pattern'] === $uri || $route['route']['pattern'] === '/.*';
827+
return $route['route']['pattern'] === $uri || $route['route']['pattern'] === '/.*' || implode('/', $route['params'] ?? []) === ltrim($uri, '/');
828828
});
829829

830830
if (empty($routesToRun)) {

0 commit comments

Comments
 (0)