mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #12365 from jbaudanza/reorder
Move Rack::Cache after ActionDispatch::Static in the middleware stack
This commit is contained in:
commit
2e296c8ee5
2 changed files with 6 additions and 6 deletions
|
@ -11,11 +11,6 @@ module Rails
|
||||||
|
|
||||||
def build_stack
|
def build_stack
|
||||||
ActionDispatch::MiddlewareStack.new.tap do |middleware|
|
ActionDispatch::MiddlewareStack.new.tap do |middleware|
|
||||||
if rack_cache = load_rack_cache
|
|
||||||
require "action_dispatch/http/rack_cache"
|
|
||||||
middleware.use ::Rack::Cache, rack_cache
|
|
||||||
end
|
|
||||||
|
|
||||||
if config.force_ssl
|
if config.force_ssl
|
||||||
middleware.use ::ActionDispatch::SSL, config.ssl_options
|
middleware.use ::ActionDispatch::SSL, config.ssl_options
|
||||||
end
|
end
|
||||||
|
@ -26,6 +21,11 @@ module Rails
|
||||||
middleware.use ::ActionDispatch::Static, paths["public"].first, config.static_cache_control
|
middleware.use ::ActionDispatch::Static, paths["public"].first, config.static_cache_control
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if rack_cache = load_rack_cache
|
||||||
|
require "action_dispatch/http/rack_cache"
|
||||||
|
middleware.use ::Rack::Cache, rack_cache
|
||||||
|
end
|
||||||
|
|
||||||
middleware.use ::Rack::Lock unless allow_concurrency?
|
middleware.use ::Rack::Lock unless allow_concurrency?
|
||||||
middleware.use ::Rack::Runtime
|
middleware.use ::Rack::Runtime
|
||||||
middleware.use ::Rack::MethodOverride
|
middleware.use ::Rack::MethodOverride
|
||||||
|
|
|
@ -61,7 +61,7 @@ module ApplicationTests
|
||||||
|
|
||||||
boot!
|
boot!
|
||||||
|
|
||||||
assert_equal "Rack::Cache", middleware.first
|
assert middleware.include?("Rack::Cache")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "ActiveRecord::Migration::CheckPending is present when active_record.migration_error is set to :page_load" do
|
test "ActiveRecord::Migration::CheckPending is present when active_record.migration_error is set to :page_load" do
|
||||||
|
|
Loading…
Reference in a new issue