aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-07-25 18:54:25 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-07-25 18:55:13 -0300
commitecd4f0b6ff8c54b9f247cd3c676c8d754baefdc3 (patch)
tree98d6751ef3580470b4a449f1fb0ed9ecba9202ed /railties/lib
parent703d0e05c0a57ec032cd6966ff82e757415bcc50 (diff)
downloadrails-ecd4f0b6ff8c54b9f247cd3c676c8d754baefdc3.tar.gz
rails-ecd4f0b6ff8c54b9f247cd3c676c8d754baefdc3.tar.bz2
rails-ecd4f0b6ff8c54b9f247cd3c676c8d754baefdc3.zip
Don't use Rack::Sendfile middleware if x_sendfile_header is not present
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 9e2f1a4b7a..fb60ddd9b5 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -163,7 +163,9 @@ module Rails
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