mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Check that Rack::Sendfile is not included unless config.action_dispatch.x_sendfile_header is set
This commit is contained in:
parent
36ab1cd293
commit
4d13e90531
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,8 @@ module ApplicationTests
|
|||
end
|
||||
|
||||
test "default middleware stack" do
|
||||
add_to_config "config.action_dispatch.x_sendfile_header = 'X-Sendfile'"
|
||||
|
||||
boot!
|
||||
|
||||
assert_equal [
|
||||
|
@ -47,6 +49,12 @@ module ApplicationTests
|
|||
], middleware
|
||||
end
|
||||
|
||||
test "Rack::Sendfile is not included by default" do
|
||||
boot!
|
||||
|
||||
assert !middleware.include?("Rack::Sendfile"), "Rack::Sendfile is not included in the default stack unless you set config.action_dispatch.x_sendfile_header"
|
||||
end
|
||||
|
||||
test "Rack::Cache is present when action_controller.perform_caching is set" do
|
||||
add_to_config "config.action_controller.perform_caching = true"
|
||||
|
||||
|
|
Loading…
Reference in a new issue