Check if path contains key before replacing
This commit is contained in:
parent
3530d3dfe0
commit
03a2a00b30
1 changed files with 3 additions and 1 deletions
|
@ -32,7 +32,9 @@ class Resolvers
|
||||||
|
|
||||||
$path = $route->getPath();
|
$path = $route->getPath();
|
||||||
foreach ($args as $key => $value) {
|
foreach ($args as $key => $value) {
|
||||||
$path = \str_replace(':' . $key, $value, $path);
|
if (\str_contains($path, $key)) {
|
||||||
|
$path = \str_replace(':' . $key, $value, $path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$swoole->server['request_method'] = $route->getMethod();
|
$swoole->server['request_method'] = $route->getMethod();
|
||||||
|
|
Loading…
Reference in a new issue