Skip to content

Commit 18d6ecc

Browse files
committed
[BUGFIX] Do not boot Slim if route prefix not exactly matched
If the route prefix is `/api`, Slim must not boot for an url like `/api-external`. In order to fix that, the route prefix is know matched like `/api/`. The only downside is that `/api` (without trailing slash) is not handled by Slim anymore.
1 parent befcc97 commit 18d6ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Middleware/SlimInitiator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
6262
continue;
6363
}
6464

65-
$prefix = $config['route'] ?? '/';
65+
$prefix = rtrim($config['route'], '/') . '/';
6666
if (strpos($request->getUri()->getPath(), $prefix) !== 0) {
6767
continue;
6868
}

0 commit comments

Comments
 (0)