Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose MiddlewareStack#unshift to environment configuration #12479

Merged
merged 1 commit into from Oct 9, 2013

Conversation

@benpickles
Copy link
Contributor

@benpickles benpickles commented Oct 9, 2013

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 pftg commented Oct 9, 2013

To complete this PR need to add Changelog entry.

@benpickles
Copy link
Contributor Author

@benpickles benpickles commented Oct 9, 2013

Thanks, I updated the changelog.

@senny
Copy link
Member

@senny senny commented Oct 9, 2013

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

josevalim added 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
1 check was pending
1 check was pending
default The Travis CI build is in progress
Details
@josevalim
Copy link
Contributor

@josevalim josevalim commented Oct 9, 2013

Thanks @benpickles / @senny / @pftg !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.