cache_rules 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 0.1.19 (2015-05-01)
4
+
5
+ * The 'max-stale' header doesn't affect 'max-age' validation
6
+
3
7
  # 0.1.18 (2015-05-01)
4
8
 
5
9
  * Ensure the 'Cache-Control: max-age' is validated
data/cache_rules.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'date'
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'cache_rules'
9
- s.version = '0.1.18'
9
+ s.version = '0.1.19'
10
10
 
11
11
  s.date = Date.today.to_s
12
12
 
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 and max-stale isn't set
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
- (!request['max-stale'] && request['max-age'] &&
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: