cache_rules 0.1.19 → 0.1.20
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/helpers.rb +1 -1
- data/test/test_helpers.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/cache_rules.gemspec
CHANGED
data/lib/helpers.rb
CHANGED
@@ -295,7 +295,7 @@ module CacheRules
|
|
295
295
|
|
296
296
|
# Don't cache heuristic responses more than 24 hours old, and avoid sending a 113 Warning ;)
|
297
297
|
# source: https://tools.ietf.org/html/rfc7234#section-4.2.2
|
298
|
-
current_age > 86400 ? 0 : result
|
298
|
+
current_age > 86400 ? 0 : (now + result)
|
299
299
|
else
|
300
300
|
0
|
301
301
|
end
|
data/test/test_helpers.rb
CHANGED
@@ -362,7 +362,7 @@ class TestHelpers < MiniTest::Test
|
|
362
362
|
too_old = CacheRules.helper_heuristic now, @cached_headers, 86401
|
363
363
|
noop = CacheRules.helper_heuristic(now, {}, 42)
|
364
364
|
|
365
|
-
assert_equal last_modified,
|
365
|
+
assert_equal last_modified, 1420378785
|
366
366
|
assert_equal not_public, 0
|
367
367
|
assert_equal too_old, 0
|
368
368
|
assert_equal noop, 0
|