Skip to content
Browse files

Don't use Rack::Sendfile middleware if x_sendfile_header is not present

  • Loading branch information...
1 parent b537595 commit 19ac034bdc9be175eff7cf54208ba14b43d97681 @spastorino spastorino committed with fxn Jul 25, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 railties/lib/rails/application.rb
View
4 railties/lib/rails/application.rb
@@ -163,7 +163,9 @@ def default_middleware_stack
middleware.use ::Rails::Rack::Logger # must come after Rack::MethodOverride to properly log overridden methods
middleware.use ::ActionDispatch::ShowExceptions, config.consider_all_requests_local
middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
- middleware.use ::Rack::Sendfile, config.action_dispatch.x_sendfile_header
+ if config.action_dispatch.x_sendfile_header.present?
+ middleware.use ::Rack::Sendfile, config.action_dispatch.x_sendfile_header
+ end
middleware.use ::ActionDispatch::Reloader unless config.cache_classes
middleware.use ::ActionDispatch::Callbacks
middleware.use ::ActionDispatch::Cookies

0 comments on commit 19ac034

Please sign in to comment.
Something went wrong with that request. Please try again.