rails/rails — pull request #12479 by benpickles (2013-10-09 10:41:10+00:00)
Title: Expose Middleware#unshift to environment configuration

Although #6372 added `#unshift` to the middleware stack this is not exposed in the environment configuration files.

I wanted to be able to add basic auth to my app and ensure that it was the first middleware to be hit, although I *could* use `#insert_before` my stack differs between environments. This change ensures that the following is possible:

```ruby
config.middleware.unshift Rack::Auth::Basic, 'Restricted Area' do |user, pwd|
[user, pwd] == ['admin', 'admin']
end
```