aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-03-29 00:41:11 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2011-03-29 00:41:11 +0530
commit910a8d22460a8b8e67a16441dadb87cc12ab7a4a (patch)
treea0561863efa0e49b6f1982b6a39182e7750c5083 /railties/lib/rails/application.rb
parent7b9bdd9253c7f8f3b89664ac616ff9bd5ea3ac87 (diff)
parent62dd3458e326b1f2927d43401e7b10004410fdf0 (diff)
downloadrails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.gz
rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.bz2
rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r--railties/lib/rails/application.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 94819820bc..1b834275a7 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -145,15 +145,21 @@ module Rails
def default_middleware_stack
ActionDispatch::MiddlewareStack.new.tap do |middleware|
- rack_cache = config.action_controller.perform_caching && config.action_dispatch.rack_cache
+ if rack_cache = config.action_controller.perform_caching && config.action_dispatch.rack_cache
+ require "action_dispatch/http/rack_cache"
+ middleware.use ::Rack::Cache, rack_cache
+ end
- require "action_dispatch/http/rack_cache" if rack_cache
- middleware.use ::Rack::Cache, rack_cache if rack_cache
+ if config.force_ssl
+ require "rack/ssl"
+ middleware.use ::Rack::SSL
+ end
if config.serve_static_assets
asset_paths = ActiveSupport::OrderedHash[config.static_asset_paths.to_a.reverse]
middleware.use ::ActionDispatch::Static, asset_paths
end
+
middleware.use ::Rack::Lock unless config.allow_concurrency
middleware.use ::Rack::Runtime
middleware.use ::Rails::Rack::Logger
@@ -174,7 +180,10 @@ module Rails
middleware.use ::ActionDispatch::Head
middleware.use ::Rack::ConditionalGet
middleware.use ::Rack::ETag, "no-cache"
- middleware.use ::ActionDispatch::BestStandardsSupport, config.action_dispatch.best_standards_support if config.action_dispatch.best_standards_support
+
+ if config.action_dispatch.best_standards_support
+ middleware.use ::ActionDispatch::BestStandardsSupport, config.action_dispatch.best_standards_support
+ end
end
end