diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-27 12:09:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-27 12:09:04 -0700 |
commit | d05d7e23d19b0f22328ad5ec3c87883c96fc4365 (patch) | |
tree | 8ff80e4018fcc63e33a2aa01281adcda76c96a2a /actionpack/lib/action_dispatch/http/cache.rb | |
parent | 53265e88067084855753522256b86568fdad5b0c (diff) | |
download | rails-d05d7e23d19b0f22328ad5ec3c87883c96fc4365.tar.gz rails-d05d7e23d19b0f22328ad5ec3c87883c96fc4365.tar.bz2 rails-d05d7e23d19b0f22328ad5ec3c87883c96fc4365.zip |
remove dependency on `@cache_control` ivar
eventually we'll remove this instance variable, but this is the first
step
Diffstat (limited to 'actionpack/lib/action_dispatch/http/cache.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/cache.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index c6ea6d8e01..08ebd2e8b2 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -131,7 +131,7 @@ module ActionDispatch def handle_conditional_get! if etag? || last_modified? || !@cache_control.empty? - set_conditional_cache_control! + set_conditional_cache_control!(@cache_control) end end @@ -141,17 +141,17 @@ module ActionDispatch PRIVATE = "private".freeze MUST_REVALIDATE = "must-revalidate".freeze - def set_conditional_cache_control! + def set_conditional_cache_control!(cache_control) control = {} cc_headers = cache_control_headers if extras = cc_headers.delete(:extras) - @cache_control[:extras] ||= [] - @cache_control[:extras] += extras - @cache_control[:extras].uniq! + cache_control[:extras] ||= [] + cache_control[:extras] += extras + cache_control[:extras].uniq! end control.merge! cc_headers - control.merge! @cache_control + control.merge! cache_control if control.empty? set_header CACHE_CONTROL, DEFAULT_CACHE_CONTROL |