Skip to content

Commit

Permalink
Freeze original Rack env to ensure no changes are made
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Feb 4, 2009
1 parent b9ad873 commit e51cb77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rack/cache/core.rb
Expand Up @@ -125,9 +125,13 @@ def fetch_from_backend

private
def perform_receive
@original_request = Request.new(@env.dup)
# Store the request env exactly as we received it. Freeze the env to
# ensure no changes are made.
@original_request = Request.new(@env.dup.freeze)

@env['REQUEST_METHOD'] = 'GET' if @original_request.head?
@request = Request.new(@env)

info "%s %s", @original_request.request_method, @original_request.fullpath
transition(from=:receive, to=[:pass, :lookup, :error])
end
Expand Down

0 comments on commit e51cb77

Please sign in to comment.