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 1 commit into from Oct 9, 2013


Copy link

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']

Copy link

pftg commented Oct 9, 2013

To complete this PR need to add Changelog entry.

Copy link
Contributor Author

Thanks, I updated the changelog.

Copy link

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
Copy link

Thanks @benpickles / @senny / @pftg !

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

Successfully merging this pull request may close these issues.

None yet

4 participants