Recognizing a given path whose route uses request.env within constraint  

Now you can call `Rails.application.routes.recognize_path` passing `request.env` as the second parameter. 

It prevents a possible `NoMethodError for nil` when you are using `request.env[‘some_custom_key’].some_method` within route constraint. For example:

```
match "/some_path", to: "some_controller#some_action", 
            constraint: ->(req) { req['warden'].user }
```
I'm against making this public API.  No part of Rails uses this method outside the request / response lifecycle, not to mention, the logic used in that method actually differs from the logic that is actually used when the router recognizes a path from the request.

I'm not against offering a public api similar to `recognize_path`, but it needs to be the same code path as the actual router.

You can call `request.path_parameters` to get the controller / action info from the current path.