Skip to content

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

Description

@Magnum5234

When you have the following route:

$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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions