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. --- Gemfile.lock | 6 +++--- actionpack/lib/action_dispatch/http/headers.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index daaa208a74..137d6e368b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,7 +27,7 @@ GIT GIT remote: git://github.com/rack/rack.git - revision: 2cb9430fce32da2f2dbccf9de97ab691351c1408 + revision: be777e06bf4de18a7786af1e44647e1498ec1a5d specs: rack (2.0.0.alpha) json @@ -203,7 +203,7 @@ GEM nokogiri (1.6.6.2) mini_portile (~> 0.6.0) pg (0.18.2) - psych (2.0.13) + psych (2.0.15) que (0.10.0) racc (1.4.12) rack-cache (1.2) @@ -252,7 +252,7 @@ GEM sigdump (0.2.3) sinatra (1.0) rack (>= 1.0) - sneakers (1.1.0) + sneakers (1.1.1) bunny (>= 1.7.0, <= 2.0.0) serverengine (~> 1.5.5) thor 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