Skip to content

Commit

Permalink
Refactored Context#strip_ignore_headers (thanks @nbibler)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm5t committed Feb 10, 2012
1 parent 0ed9a12 commit 12ae92d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/rack/cache/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,7 @@ def store(response)

# Remove all ignored response headers before writing to the cache.
def strip_ignore_headers(response)
stripped = false
ignore_headers.each do |name|
stripped ||= response.headers.delete(name)
response.headers.delete(name)
end
record :ignore if stripped
record :ignore if response.headers.reject! { |name, value| ignore_headers.include? name }
end

def log_error(exception)
Expand Down

0 comments on commit 12ae92d

Please sign in to comment.