Skip to content
Browse files

live response headers can be merged with a hash

  • Loading branch information...
1 parent 621e079 commit 8f0541b702f023c3c0841a47747ba0c793fcbb17 @tenderlove tenderlove committed Aug 13, 2012
Showing with 10 additions and 0 deletions.
  1. +4 −0 actionpack/lib/action_controller/metal/live.rb
  2. +6 −0 actionpack/test/dispatch/live_response_test.rb
View
4 actionpack/lib/action_controller/metal/live.rb
@@ -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
View
6 actionpack/test/dispatch/live_response_test.rb
@@ -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

0 comments on commit 8f0541b

Please sign in to comment.
Something went wrong with that request. Please try again.