Permalink
Browse files

dup the request and mutate its headers object.

duping the request will dup it's underlying env hash.
  • Loading branch information...
tenderlove committed Aug 21, 2015
1 parent ffc4710 commit 1fbf5ad7f71f8b6fdf9639eb85f5fe9733c045bd
Showing with 5 additions and 5 deletions.
  1. +3 −3 Gemfile.lock
  2. +2 −2 actionpack/lib/action_dispatch/http/headers.rb
View
@@ -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
@@ -66,13 +66,13 @@ def fetch(key, *args, &block)
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

0 comments on commit 1fbf5ad

Please sign in to comment.