diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-05-06 14:22:05 -0500 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-05-06 14:22:05 -0500 |
commit | 21a3b180f11e49e1cd296aacba3bec8120dc7c2e (patch) | |
tree | 80053ca78b371d2f9647626c38d328dcb8a4f302 /actionpack/lib/action_controller | |
parent | 40d5c3370f8e5e0d3d03a7a25a64fde5122a069e (diff) | |
parent | b43158afba7fb4de6a3530d4f4e940f0c89bd057 (diff) | |
download | rails-21a3b180f11e49e1cd296aacba3bec8120dc7c2e.tar.gz rails-21a3b180f11e49e1cd296aacba3bec8120dc7c2e.tar.bz2 rails-21a3b180f11e49e1cd296aacba3bec8120dc7c2e.zip |
Merge pull request #24029 from rthbound/dont-call-each-when-calling-body-on-response
Dont call each when calling body on response to fix #23964
Fixes #23964
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/live.rb | 16 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb index 6055fde4f7..5d395cd8bd 100644 --- a/actionpack/lib/action_controller/metal/live.rb +++ b/actionpack/lib/action_controller/metal/live.rb @@ -163,14 +163,6 @@ module ActionController end end - def each - @response.sending! - while str = @buf.pop - yield str - end - @response.sent! - end - # Write a 'close' event to the buffer; the producer/writing thread # uses this to notify us that it's finished supplying content. # @@ -210,6 +202,14 @@ module ActionController def call_on_error @error_callback.call end + + private + + def each_chunk(&block) + while str = @buf.pop + yield str + end + end end class Response < ActionDispatch::Response #:nodoc: all diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index ecd21f29ce..ed2edcbe06 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -554,6 +554,8 @@ module ActionController end @request.query_string = '' + @response.sent! + @response end |