rack-cache 1.14.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/cache/headers.rb +21 -0
- data/lib/rack/cache/response.rb +3 -11
- data/lib/rack/cache/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e551d4e48499cda1a41809df4010eaf84bb5cf75edb113543a803cf4b7a5f2a6
|
4
|
+
data.tar.gz: 33d4f98db1ba1c858bbf0337e249c7d121e0f14f3705e00934f2adb29ddccddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d068832ba4eb458626148d0ccd9d4485f82305934fa97201b8b4d2ffad975a50e2c8152129c2a0f95971ed172184246e9dcd12de308324dbdb7b04f4792d9537
|
7
|
+
data.tar.gz: 035b6979668d9315fb9a29f081df044c64f34380f54dd4c16b0b3a13534fe205fae9d2d30bcd8fe682f2747b5aa8ab40e736fea1774841364165da80065d0b66
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Rack::Cache
|
2
|
+
begin
|
3
|
+
# For `Rack::Headers` (Rack 3+):
|
4
|
+
require "rack/headers"
|
5
|
+
Headers = ::Rack::Headers
|
6
|
+
def self.Headers(headers)
|
7
|
+
Headers[headers]
|
8
|
+
end
|
9
|
+
rescue LoadError
|
10
|
+
# For `Rack::Utils::HeaderHash`:
|
11
|
+
require "rack/utils"
|
12
|
+
Headers = ::Rack::Utils::HeaderHash
|
13
|
+
def self.Headers(headers)
|
14
|
+
if headers.is_a?(Headers) && !headers.frozen?
|
15
|
+
return headers
|
16
|
+
else
|
17
|
+
return Headers.new(headers)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/rack/cache/response.rb
CHANGED
@@ -3,17 +3,9 @@ require 'set'
|
|
3
3
|
require 'rack/response'
|
4
4
|
require 'rack/cache/cache_control'
|
5
5
|
|
6
|
-
|
7
|
-
begin
|
8
|
-
# For `Rack::Headers` (Rack 3+):
|
9
|
-
require "rack/headers"
|
10
|
-
Headers = ::Rack::Headers
|
11
|
-
rescue LoadError
|
12
|
-
# For `Rack::Utils::HeaderHash`:
|
13
|
-
require "rack/utils"
|
14
|
-
Headers = ::Rack::Utils::HeaderHash
|
15
|
-
end
|
6
|
+
require_relative 'headers'
|
16
7
|
|
8
|
+
module Rack::Cache
|
17
9
|
# Provides access to the response generated by the downstream application. The
|
18
10
|
# +response+, +original_response+, and +entry+ objects exposed by the Core
|
19
11
|
# caching engine are instances of this class.
|
@@ -39,7 +31,7 @@ module Rack::Cache
|
|
39
31
|
# and body.
|
40
32
|
def initialize(status, headers, body)
|
41
33
|
@status = status.to_i
|
42
|
-
@headers = Headers
|
34
|
+
@headers = Rack::Cache::Headers(headers)
|
43
35
|
@body = body
|
44
36
|
@now = Time.now
|
45
37
|
@headers['date'] ||= @now.httpdate
|
data/lib/rack/cache/version.rb
CHANGED
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.
|
4
|
+
version: 1.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tomayko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/rack/cache/context.rb
|
160
160
|
- lib/rack/cache/entity_store.rb
|
161
161
|
- lib/rack/cache/entitystore.rb
|
162
|
+
- lib/rack/cache/headers.rb
|
162
163
|
- lib/rack/cache/key.rb
|
163
164
|
- lib/rack/cache/meta_store.rb
|
164
165
|
- lib/rack/cache/metastore.rb
|
@@ -192,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
193
|
- !ruby/object:Gem::Version
|
193
194
|
version: '0'
|
194
195
|
requirements: []
|
195
|
-
rubygems_version: 3.4.
|
196
|
+
rubygems_version: 3.4.22
|
196
197
|
signing_key:
|
197
198
|
specification_version: 4
|
198
199
|
summary: HTTP Caching for Rack
|