response_bank 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/response_bank/response_cache_handler.rb +8 -2
- data/lib/response_bank/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2fbaca21dd928ad2b387d10300acbbb61dedca00a8cdab23247484af8c749bf
|
4
|
+
data.tar.gz: a4f81948c53b5e574e5bd3cb3a3c9d621c387a3040706aa0ee873ffc5dab5362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3a0956f4ab5b627d4e80f4349c16cc830b49eecb602357b52aedc3e60703ddd2547bca663656d28b4525dfd9f47a4b67d226f9eaca4322ff9da1acfa1351c00
|
7
|
+
data.tar.gz: 602e5ed4aca5b96d30b61fed0d90c814689424b986374f9f6030ee4f03c6c41db6138cd7542be475bd86c3cb94fcd77453d52a6e7b58c5d954f50ca2a25ead3b
|
@@ -166,13 +166,19 @@ module ResponseBank
|
|
166
166
|
# If-None-Match: "abc"
|
167
167
|
# If-None-Match: W/"abc"
|
168
168
|
# If-None-Match: "abc", "def"
|
169
|
-
# If-None-Match:
|
169
|
+
# If-None-Match: *
|
170
170
|
return false unless entity_tag
|
171
171
|
return false unless if_none_match
|
172
172
|
|
173
|
+
return true if if_none_match == "*"
|
174
|
+
|
173
175
|
# strictly speaking an unquoted etag is not valid, yet common
|
174
176
|
# to avoid unintended greedy matches in we check for naked entity then includes with quoted entity values
|
175
|
-
|
177
|
+
entity_tag = %{"#{entity_tag}"} unless entity_tag.starts_with?('"')
|
178
|
+
|
179
|
+
if_none_match = %{"#{if_none_match}"} unless if_none_match.starts_with?('"') || if_none_match.starts_with?('W/"')
|
180
|
+
|
181
|
+
if_none_match == entity_tag || if_none_match.include?(entity_tag)
|
176
182
|
end
|
177
183
|
|
178
184
|
def stale_while_revalidate?(timestamp, cache_age_tolerance)
|