Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 77aee5d

Browse files
committed
fix: patch up grouped middleware bug
1 parent a18b707 commit 77aee5d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Router.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public static function group(string $path, $handler)
9797
*/
9898
public static function match(string $methods, string $pattern, $handler)
9999
{
100+
$rawPattern = $pattern;
100101
$pattern = static::$groupRoute . '/' . trim($pattern, '/');
101102
$pattern = static::$groupRoute ? rtrim($pattern, '/') : $pattern;
102103

@@ -143,7 +144,7 @@ public static function match(string $methods, string $pattern, $handler)
143144
}
144145

145146
if ($routeOptions['middleware']) {
146-
static::before($methods, $pattern, $routeOptions['middleware']);
147+
static::before($methods, $rawPattern, $routeOptions['middleware']);
147148
}
148149
}
149150

0 commit comments

Comments
 (0)