提交 9af42581 编写于 作者: A Aaron Patterson

set the error callback to a nice default in case nobody set an error callback and an error happens

上级 a92c7078
......@@ -108,7 +108,7 @@ def perform_write(json, options)
class Buffer < ActionDispatch::Response::Buffer #:nodoc:
def initialize(response)
@error_callback = nil
@error_callback = lambda { true }
super(response, SizedQueue.new(10))
end
......
......@@ -313,4 +313,11 @@ def test_stale_with_etag
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册