This project is archived and is in readonly mode.
Fixing config.action_dispatch.x_sendfile_header default
-
fkocherga
Cannot attach file, some lighthouseapp problems, the patch is very simple:
actionpack/lib/action_dispatch/railtie.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/actionpack/lib/action_dispatch/railtie.rb b/actionpack/lib/action_dispatch/railtie.rb
index ed93211..5aa217b 100644
--- a/actionpack/lib/action_dispatch/railtie.rb +++ b/actionpack/lib/action_dispatch/railtie.rb @@ -4,7 +4,7 @@ require "rails" module ActionDispatch class Railtie < Rails::Railtieconfig.action_dispatch = ActiveSupport::OrderedOptions.new- config.action_dispatch.x_sendfile_header = ""
- config.action_dispatch.x_sendfile_header = nil config.action_dispatch.ip_spoofing_check = true config.action_dispatch.show_exceptions = true
@@ -13,4 +13,3 @@ module ActionDispatch
ActionDispatch::Callbacks.to_prepare { app.routes_reloader.execute_if_updated } endend -- 1.7.0.4
-
fkocherga
Formatted properly:
--- actionpack/lib/action_dispatch/railtie.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/railtie.rb b/actionpack/lib/action_dispatch/railtie.rb index ed93211..5aa217b 100644 --- a/actionpack/lib/action_dispatch/railtie.rb +++ b/actionpack/lib/action_dispatch/railtie.rb @@ -4,7 +4,7 @@ require "rails" module ActionDispatch class Railtie < Rails::Railtie config.action_dispatch = ActiveSupport::OrderedOptions.new - config.action_dispatch.x_sendfile_header = "" + config.action_dispatch.x_sendfile_header = nil config.action_dispatch.ip_spoofing_check = true config.action_dispatch.show_exceptions = true @@ -13,4 +13,3 @@ module ActionDispatch ActionDispatch::Callbacks.to_prepare { app.routes_reloader.execute_if_updated } end end -- 1.7.0.4 -
Bruno Michel
- Tag changed from tagged:x-sendfile to patch, tagged:x-sendfile
-
Andrea Campi
-1, the current behavior is intended and documented (barely, in the generated application.rb):
# If you have no front-end server that supports something like X-Sendfile, # just comment this out and Rails will serve the filesIt seems to me you can configure autodetection based on X-Sendfile-Type by setting
config.action_dispatch.x_sendfile_header=nilin your environment?
If that's the case, it should probably be documented.
If you can confirm that's the case, I can take care of updating the documentation. -
Bertg
I think the default behaviour is confusing. and the patch should be applied, and have the documentation reflect this behaviour.
I can't think of any reason why Rails should, by default, disable the auto detection of these settings.
-
Andrea Campi
@Bertg: feel free to provide a patch that changes both the code and the documentation. Note that Rails is not disabling auto-detection; the developer is, if she comments out the line as directed by the documentation.
-
Andrea Campi
- Tag changed from patch, tagged:x-sendfile to actiondispatch, patch, x-sendfile
