protocol-http 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protocol/http/header/cache_control.rb +10 -0
- data/lib/protocol/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a8ecc7ff666bfe900451d95f8fb7fa40f67caa5ca686844b827c19729816693
|
4
|
+
data.tar.gz: 4acbac83b751e2602479adc863c6b75f7bb2bba9bbe4dfc30a6151435c8f2ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be4092bb56744f84e434cc8de3d3b7d7632cfdbe2d424e4153b5204cefd17bdf0cb64304070e5ed2f4070bab08d25cbb4e0ae04daad1157bb6cdc03da4b44385
|
7
|
+
data.tar.gz: d1b4cdd713e5b03eba86c6c3ed63f5097eddc4e343d187cf2957378abfcb5094b103a2c3df6c19e3209afcafb7d3950eb4eb387400b548ad42da88a580ad7a5d
|
@@ -29,6 +29,8 @@ module Protocol
|
|
29
29
|
class CacheControl < Split
|
30
30
|
PRIVATE = 'private'
|
31
31
|
PUBLIC = 'public'
|
32
|
+
NO_CACHE = 'no-cache'
|
33
|
+
NO_STORE = 'no-store'
|
32
34
|
MAX_AGE = 'max-age'
|
33
35
|
|
34
36
|
def initialize(value)
|
@@ -47,6 +49,14 @@ module Protocol
|
|
47
49
|
self.include?(PUBLIC)
|
48
50
|
end
|
49
51
|
|
52
|
+
def no_cache?
|
53
|
+
self.include?(NO_CACHE)
|
54
|
+
end
|
55
|
+
|
56
|
+
def no_store?
|
57
|
+
self.include?(NO_STORE)
|
58
|
+
end
|
59
|
+
|
50
60
|
def max_age
|
51
61
|
if value = self.find{|value| value.start_with?(MAX_AGE)}
|
52
62
|
_, age = value.split('=', 2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: covered
|