Skip to content

Commit

Permalink
Removing sendfile middleware from default. Loading sendfile when x_se…
Browse files Browse the repository at this point in the history
…ndfile_header is true
  • Loading branch information
arunagw committed Jul 26, 2011
1 parent 36ab1cd commit f49ca63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion railties/test/application/middleware_test.rb
Expand Up @@ -31,7 +31,6 @@ def app
"Rails::Rack::Logger", # must come after Rack::MethodOverride to properly log overridden methods
"ActionDispatch::ShowExceptions",
"ActionDispatch::RemoteIp",
"Rack::Sendfile",
"ActionDispatch::Reloader",
"ActionDispatch::Callbacks",
"ActiveRecord::ConnectionAdapters::ConnectionManagement",
Expand All @@ -55,6 +54,12 @@ def app
assert_equal "Rack::Cache", middleware.first
end

test "Rack::Sendfile is present when action_dispatch.x_sendfile_header is set" do
add_to_config "config.action_dispatch.x_sendfile_header = true"
boot!
assert middleware.include?("Rack::Sendfile")
end

test "Rack::SSL is present when force_ssl is set" do
add_to_config "config.force_ssl = true"
boot!
Expand Down

0 comments on commit f49ca63

Please sign in to comment.