aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-21 16:40:53 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-21 16:59:12 -0700
commit1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd (patch)
treefb7d33654596a8ccc0c3d4b49a50961936651ce2 /actionpack/lib
parentffc4710c2bff273b82ddb76675701f986d82ef4f (diff)
downloadrails-1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd.tar.gz
rails-1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd.tar.bz2
rails-1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd.zip
dup the request and mutate its headers object.
duping the request will dup it's underlying env hash.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/headers.rb4
1 files changed, 2 insertions, 2 deletions
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
# <tt>headers_or_env</tt> 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