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 }
```
Actually, it is @rafaelfranca. My app has a middleware which uses `Rails.application.routes.recognize_path(request.path)`. And the same app has the following route:

```
mount Sidekiq::Web => '/sidekiq',
       constraints: ->(req) { req.env["warden"].user.admin? }
```

As `recognize_path` creates (internally) a new `env` using `Rack::MockRequest.env_for` considering just `method`, `warden` key is null which causes an error.