提交 8f0541b7 编写于 作者: A Aaron Patterson

live response headers can be merged with a hash

上级 621e0792
......@@ -72,6 +72,10 @@ def []=(k,v)
super
end
def merge(other)
self.class.new @response, __getobj__.merge(other)
end
def to_hash
__getobj__.dup
end
......
......@@ -8,6 +8,12 @@ def setup
@response = Live::Response.new
end
def test_header_merge
header = @response.header.merge('Foo' => 'Bar')
assert_kind_of(ActionController::Live::Response::Header, header)
refute_equal header, @response.header
end
def test_parallel
latch = ActiveSupport::Concurrency::Latch.new
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册