cache_rules 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.14 (2015-04-28)
4
+
5
+ * Ensure Cache-Control is verified
6
+
3
7
  ## 0.1.13 (2015-04-28)
4
8
 
5
9
  * Don't cache the Host header
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.13'
9
+ s.version = '0.1.14'
10
10
 
11
11
  s.date = Date.today.to_s
12
12
 
data/lib/validations.rb CHANGED
@@ -90,11 +90,13 @@ module CacheRules
90
90
 
91
91
  # source: https://tools.ietf.org/html/rfc7234#section-5.2.2.2
92
92
  # source: https://tools.ietf.org/html/rfc7234#section-3.2
93
- return 1 if (( cached = cached_headers['Cache-Control'] )) &&
94
- helper_no_cache.call(cached_headers) ||
95
- (cached['no-cache'] && cached['no-cache']['quoted_string'].nil?) ||
96
- (cached['s-maxage'] && cached['s-maxage']['token'].to_s == "0") ||
97
- (cached['max-age'] && cached['max-age']['token'].to_s == "0")
93
+ if cached_headers['Cache-Control']
94
+ return 1 if (( cached = cached_headers['Cache-Control'] )) &&
95
+ helper_no_cache.call(cached_headers) ||
96
+ (cached['no-cache'] && cached['no-cache']['quoted_string'].nil?) ||
97
+ (cached['s-maxage'] && cached['s-maxage']['token'].to_s == "0") ||
98
+ (cached['max-age'] && cached['max-age']['token'].to_s == "0")
99
+ end
98
100
 
99
101
  # source: https://tools.ietf.org/html/rfc7234#section-5.4
100
102
  # Legacy support for HTTP/1.0 Pragma header
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.13
4
+ version: 0.1.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: