From 56171b47c65233b675fb244e8662f6b6e6372077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C3=B3jcik?= Date: Thu, 27 Mar 2025 11:41:23 +0100 Subject: [PATCH] fix(security): request object leakage --- src/ChainRouter.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ChainRouter.php b/src/ChainRouter.php index 7c146d2..b0a9faa 100644 --- a/src/ChainRouter.php +++ b/src/ChainRouter.php @@ -173,11 +173,9 @@ private function doMatch(string $pathinfo, ?Request $request = null): array } } - $info = $request - ? "this request\n$request" - : "url '$pathinfo'"; + $info = $request ? $request->getPathInfo() : $pathinfo; - throw $methodNotAllowed ?: new ResourceNotFoundException("None of the routers in the chain matched $info"); + throw $methodNotAllowed ?: new ResourceNotFoundException("None of the routers in the chain matched url $info"); } /**