cache_rules 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/cache_rules.gemspec +1 -1
- data/lib/validations.rb +2 -2
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/cache_rules.gemspec
CHANGED
data/lib/validations.rb
CHANGED
@@ -92,11 +92,11 @@ module CacheRules
|
|
92
92
|
if request_headers['Cache-Control']
|
93
93
|
_, current_age = helper_freshness_lifetime.call cached_headers
|
94
94
|
|
95
|
-
# If max-age is 0 or if the current age is above the max-age
|
95
|
+
# If max-age is 0 or if the current age is above the max-age
|
96
96
|
# source: https://tools.ietf.org/html/rfc7234#section-5.2.1.1
|
97
97
|
return 1 if (( request = request_headers['Cache-Control'] )) &&
|
98
98
|
request['no-cache'] ||
|
99
|
-
(
|
99
|
+
(request['max-age'] &&
|
100
100
|
(request['max-age']['token'].to_s == "0" || current_age > request['max-age']['token'].to_i))
|
101
101
|
end
|
102
102
|
|