Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check that Rack::Sendfile is not included unless config.action_dispat…

…ch.x_sendfile_header is set
  • Loading branch information...
commit 34ca9c122c26dc3e073e52ecdf267cb23885c1df 1 parent cd5f54c
@spastorino spastorino authored fxn committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 railties/test/application/middleware_test.rb
View
8 railties/test/application/middleware_test.rb
@@ -20,6 +20,8 @@ def app
end
test "default middleware stack" do
+ add_to_config "config.action_dispatch.x_sendfile_header = 'X-Sendfile'"
+
boot!
assert_equal [
@@ -47,6 +49,12 @@ def app
], 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"
Please sign in to comment.
Something went wrong with that request. Please try again.