slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

RouteParser is not always present #2983

Closed l0gicgate closed 3 years ago

l0gicgate commented 4 years ago

When the RoutingMiddleware is automatically instantiated by the RouteRunner because routing was not performed: https://github.com/slimphp/Slim/blob/4.x/Slim/Routing/RouteRunner.php#L72

It calls performRouting but that means it doesn't append the RouteParser via this call since process is never called: https://github.com/slimphp/Slim/blob/4.x/Slim/Middleware/RoutingMiddleware.php#L58

We need to fix this by moving that line into the performRouting method.

l0gicgate commented 4 years ago

@adriansuter I tried reaching out to you via Slack but it doesn't look like you've been active. Is there a way for me to direct message you somewhere else? I have something to ask you.