diff --git a/src/Dispatcher.php b/src/Dispatcher.php index eb651c9..944ebf0 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -40,7 +40,9 @@ public function dispatchRequest(ServerRequestInterface $request): ResponseInterf case FastRoute::FOUND: $route = $this->ensureHandlerIsRoute($match[1], $method, $uri)->setVars($match[2]); - if ($this->isExtraConditionMatch($route, $request)) { + $request = $request->withAttribute('route', $route); + + if ($this->isExtraConditionMatch($route, $request)) { $this->setFoundMiddleware($route); $request = $this->requestWithRouteAttributes($request, $route); break;