We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfc9a46 commit 546164fCopy full SHA for 546164f
src/WaterPipe/HTTP/Request/RequestUri.php
@@ -79,7 +79,7 @@ public function setPattern(string $pattern): RequestUri
79
*/
80
public function setUri(string $uri): RequestUri
81
{
82
- $this->_uri = $uri;
+ $this->_uri = "/" . trim($uri, "/");
83
return $this;
84
}
85
@@ -148,7 +148,7 @@ public function isBuilt(): bool
148
public static function isMatch(string $pattern, string $uri): bool
149
150
$pattern = self::pattern2regex($pattern);
151
- return preg_match("#^{$pattern}\$#", $uri) != false;
+ return preg_match("#^{$pattern}\$#", "/" . trim($uri, "/")) != false;
152
153
154
private static function _getUriParams(string $pattern): array
0 commit comments