diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-19 15:04:28 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-19 15:04:28 +0200 |
commit | 069e9b004f91c4ace1373ab5203bb00ab41bd1f9 (patch) | |
tree | ee757c414241223251b10a86f4163f1ee4ccc45e /actionpack/lib/action_controller | |
parent | b398520c1406824efd12df6bb57996aa9781f876 (diff) | |
download | rails-069e9b004f91c4ace1373ab5203bb00ab41bd1f9.tar.gz rails-069e9b004f91c4ace1373ab5203bb00ab41bd1f9.tar.bz2 rails-069e9b004f91c4ace1373ab5203bb00ab41bd1f9.zip |
Do not stream on HTTP/1.0.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/streaming.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index adb3e94134..b9bd49f670 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -38,9 +38,13 @@ module ActionController #:nodoc: def _process_options(options) #:nodoc: super if options[:stream] - headers["Cache-Control"] ||= "no-cache" - headers["Transfer-Encoding"] = "chunked" - headers.delete("Content-Length") + if env["HTTP_VERSION"] == "HTTP/1.0" + options.delete(:stream) + else + headers["Cache-Control"] ||= "no-cache" + headers["Transfer-Encoding"] = "chunked" + headers.delete("Content-Length") + end end end |