diff options
-rw-r--r-- | actionpack/lib/action_controller/metal/live.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/live_stream_test.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb index fdf4ef293d..5ef4f6ccda 100644 --- a/actionpack/lib/action_controller/metal/live.rb +++ b/actionpack/lib/action_controller/metal/live.rb @@ -108,7 +108,7 @@ module ActionController class Buffer < ActionDispatch::Response::Buffer #:nodoc: def initialize(response) - @error_callback = nil + @error_callback = lambda { true } super(response, SizedQueue.new(10)) end diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb index fb6a750089..934915fc5b 100644 --- a/actionpack/test/controller/live_stream_test.rb +++ b/actionpack/test/controller/live_stream_test.rb @@ -313,4 +313,11 @@ module ActionController assert_equal 304, @response.status.to_i end end + + class BufferTest < ActionController::TestCase + def test_nil_callback + buf = ActionController::Live::Buffer.new nil + assert buf.call_on_error + end + end end |