aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorPatrick Toomey <ptoomey3@biasedcoin.com>2017-08-22 12:45:22 -0600
committerPatrick Toomey <ptoomey3@biasedcoin.com>2017-08-22 12:45:22 -0600
commit8a7e91b084c9d502ebe569c6c64616f1ebdba7fd (patch)
treef4fb826fd34998bafd71ae77feedb8c92d8724b9 /actionpack/lib/action_dispatch
parent665ac7cff212d010a3573f85cea895666fbaad15 (diff)
downloadrails-8a7e91b084c9d502ebe569c6c64616f1ebdba7fd.tar.gz
rails-8a7e91b084c9d502ebe569c6c64616f1ebdba7fd.tar.bz2
rails-8a7e91b084c9d502ebe569c6c64616f1ebdba7fd.zip
Normalize/process Cach-Control headers consistently
In the existing logic, the `Cache-Control` header may or may not get normalized by additional logic depending on whether `response.cache_conrol` has been modified. This leads to inconsistent behavior, since sometimes `Cache-Control` can contain whatever a user sets and sometimes it gets normalized, based on the logic inside of `set_conditional_cache_control!`. It seems like this normalization process should happen regardless to ensure consistent behavior.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/cache.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb
index 2cc609406a..eaff10cb54 100644
--- a/actionpack/lib/action_dispatch/http/cache.rb
+++ b/actionpack/lib/action_dispatch/http/cache.rb
@@ -167,9 +167,7 @@ module ActionDispatch
end
def handle_conditional_get!
- if etag? || last_modified? || !@cache_control.empty?
- set_conditional_cache_control!(@cache_control)
- end
+ set_conditional_cache_control!(@cache_control)
end
DEFAULT_CACHE_CONTROL = "max-age=0, private, must-revalidate".freeze