diff options
Diffstat (limited to 'railties/lib/rails/initializer.rb')
-rw-r--r-- | railties/lib/rails/initializer.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/railties/lib/rails/initializer.rb b/railties/lib/rails/initializer.rb index 72d23f2642..d05cb69ffe 100644 --- a/railties/lib/rails/initializer.rb +++ b/railties/lib/rails/initializer.rb @@ -272,7 +272,19 @@ module Rails # Include middleware to serve up static assets Initializer.default.add :initialize_static_server do if configuration.frameworks.include?(:action_controller) && configuration.serve_static_assets - configuration.middleware.insert(0, ActionDispatch::Static, Rails.public_path) + configuration.middleware.use(ActionDispatch::Static, Rails.public_path) + end + end + + Initializer.default.add :initialize_middleware_stack do + if configuration.frameworks.include?(:action_controller) + configuration.middleware.use(::Rack::Lock) unless ActionController::Base.allow_concurrency + configuration.middleware.use(ActionDispatch::ShowExceptions, ActionController::Base.consider_all_requests_local) + configuration.middleware.use(ActionDispatch::Callbacks, ActionController::Dispatcher.prepare_each_request) + configuration.middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options }) + configuration.middleware.use(ActionDispatch::ParamsParser) + configuration.middleware.use(::Rack::MethodOverride) + configuration.middleware.use(::Rack::Head) end end |