From 1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 21 Aug 2015 16:40:53 -0700 Subject: dup the request and mutate its headers object. duping the request will dup it's underlying env hash. --- actionpack/lib/action_dispatch/http/headers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb index 40053e521a..05191ff2fd 100644 --- a/actionpack/lib/action_dispatch/http/headers.rb +++ b/actionpack/lib/action_dispatch/http/headers.rb @@ -66,13 +66,13 @@ module ActionDispatch end def each(&block) - env.each(&block) + @req.each_header(&block) end # Returns a new Http::Headers instance containing the contents of # headers_or_env and the original instance. def merge(headers_or_env) - headers = Http::Headers.new(ActionDispatch::Request.new(env.dup)) + headers = @req.dup.headers headers.merge!(headers_or_env) headers end -- cgit v1.2.3