Skip to content

Commit e67f3fc

Browse files
committed
Let the request uri detection be more permissive
1 parent 790a1dc commit e67f3fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/WaterPipe/HTTP/Request/RequestUri.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@ public function isBuilt(): bool
193193
public static function isMatch(string $pattern, string $uri): bool
194194
{
195195
$pattern = self::pattern2regex($pattern);
196-
return preg_match("#^{$pattern}\$#", "/" . trim($uri, "/")) != false;
196+
return (
197+
preg_match("#^{$pattern}\$#", "/" . trim($uri, "/") . "/") ||
198+
preg_match("#^{$pattern}\$#", "/" . trim($uri, "/")) ||
199+
preg_match("#^{$pattern}\$#", trim($uri, "/")) ||
200+
preg_match("#^{$pattern}\$#", $uri)
201+
) != false;
197202
}
198203

199204
private static function _getUriParams(string $pattern): array

0 commit comments

Comments
 (0)