rack-cache 1.7.0 → 1.7.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfb0b7e413146e05683b9ee05ea5284209929be6
4
- data.tar.gz: e78fae89f8f289829573052c82d7f17dd2f5e597
3
+ metadata.gz: 1e47b46344d3ab3b5ff9993516e85a8c840a0d35
4
+ data.tar.gz: 44c3a6c1a3f31f304d2c38eaea81d4b253d5e43c
5
5
  SHA512:
6
- metadata.gz: 2f9fc1f96cfd00a4f567f0c5824653f00d796041e046b1ab082cbdc53698d0455d8f91ce55279dd56268e227c2237b670d84913fc580e8be6a5bafb0977d19b3
7
- data.tar.gz: 358deaeffc3dcebe11544ef7b1c458a6cb3b62f5e2ae38ac05faa51d4fc2ebde155a496088df7b559d8780629aaee03bdceaec5e95c980a659aba606b8f94490
6
+ metadata.gz: 47949eee685d0b35d4e16fb5e321fca7c027e1f940c6e1c7132b0d42612595a0541faa12d03361030f1dad5bfbf453c23cf82488cc376c3bd12ffdbb99c6239a
7
+ data.tar.gz: c2e0a5bea5febf551273d9681c00bc824bdd41c6a7b36f80b09475feaccd7e7705c2ec946270dd94435c55eeb43aaff7dea82f6d26e56a216f5d8f864d8fabe7
data/README.md CHANGED
@@ -55,9 +55,12 @@ caching.
55
55
  Using with Rails
56
56
  ----------------
57
57
 
58
- Add this to your `config/environment.rb`:
58
+ Either of these but not both:
59
59
 
60
60
  ```Ruby
61
+ # config/application.rb
62
+ config.action_dispatch.rack_cache = true
63
+ # or
61
64
  config.middleware.use Rack::Cache,
62
65
  verbose: true,
63
66
  metastore: 'file:/var/cache/rack/meta',
@@ -68,9 +71,7 @@ You should now see `Rack::Cache` listed in the middleware pipeline:
68
71
 
69
72
  rake middleware
70
73
 
71
- See the following for more information:
72
-
73
- http://snippets.aktagon.com/snippets/302-how-to-setup-and-use-rack-cache-with-rails
74
+ [more information](http://snippets.aktagon.com/snippets/302-how-to-setup-and-use-rack-cache-with-rails)
74
75
 
75
76
  Using with Dalli
76
77
  ----------------
@@ -133,8 +133,8 @@ module Rack::Cache
133
133
  headers['Age'] = max_age.to_s if fresh?
134
134
  end
135
135
 
136
- # The date, as specified by the Date header. When no Date header is present,
137
- # set the Date header to Time.now and return.
136
+ # The date, as specified by the Date header. When no Date header is present
137
+ # or is unparseable, set the Date header to Time.now and return.
138
138
  def date
139
139
  if date = headers['Date']
140
140
  Time.httpdate(date)
@@ -142,6 +142,9 @@ module Rack::Cache
142
142
  headers['Date'] = now.httpdate unless headers.frozen?
143
143
  now
144
144
  end
145
+ rescue ArgumentError
146
+ headers['Date'] = now.httpdate unless headers.frozen?
147
+ now
145
148
  end
146
149
 
147
150
  # The age of the response.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Tomayko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack