Skip to content

Conversation

@benpickles
Copy link
Contributor

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:

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

@pftg
Copy link
Contributor

pftg commented Oct 9, 2013

To complete this PR need to add Changelog entry.

@benpickles
Copy link
Contributor Author

Thanks, I updated the changelog.

@senny
Copy link
Member

senny commented Oct 9, 2013

@josevalim I've seen you merged #6372 can you take a look?

josevalim pushed a commit that referenced this pull request Oct 9, 2013
Expose MiddlewareStack#unshift to environment configuration
@josevalim josevalim merged commit 47ee9fe into rails:master Oct 9, 2013
@josevalim
Copy link
Contributor

Thanks @benpickles / @senny / @pftg !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants