Permalink
Browse files

Refactored Context#strip_ignore_headers (thanks @nbibler)

  • Loading branch information...
1 parent 0ed9a12 commit 12ae92d16b5c1c7bbd1b1db5600909485a7e673c @rmm5t committed Feb 10, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/rack/cache/context.rb
@@ -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)

0 comments on commit 12ae92d

Please sign in to comment.