#3374·Slim

Routing does not match (slash %2F in path parameter)

Author: Magnum5234Created Mar 3, 2025Updated Mar 26, 2026
LabelsSlim 5

When you have the following route:

php
$router->any('/something/{magic}/{foo}', function (ServerRequestInterface $request, Response $response, array $args) use ($app) {
   // do something 
});

And Call this URL:

https://some.host/something/magic/foo%2Fbar

It will not match. I tried to check what went wrong. In $_SERVER I get:

["REQUEST_URI"]=>
  string(32) "/something/magic/foo%2Fbar"

It however matches when commenting out: https://github.com/slimphp/Slim/blob/4.x/Slim/Routing/RouteResolver.php#L42

Not sure why this is there tbh? If you want the route parameter to be decoded, shouldn't this be done after routing is done?