Skip to content
This repository
Browse code

live response headers can be merged with a hash

  • Loading branch information...
commit 8f0541b702f023c3c0841a47747ba0c793fcbb17 1 parent 621e079
Aaron Patterson tenderlove authored
4 actionpack/lib/action_controller/metal/live.rb
@@ -72,6 +72,10 @@ def []=(k,v)
72 72 super
73 73 end
74 74
  75 + def merge(other)
  76 + self.class.new @response, __getobj__.merge(other)
  77 + end
  78 +
75 79 def to_hash
76 80 __getobj__.dup
77 81 end
6 actionpack/test/dispatch/live_response_test.rb
@@ -8,6 +8,12 @@ def setup
8 8 @response = Live::Response.new
9 9 end
10 10
  11 + def test_header_merge
  12 + header = @response.header.merge('Foo' => 'Bar')
  13 + assert_kind_of(ActionController::Live::Response::Header, header)
  14 + refute_equal header, @response.header
  15 + end
  16 +
11 17 def test_parallel
12 18 latch = ActiveSupport::Concurrency::Latch.new
13 19

0 comments on commit 8f0541b

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