protocol-http 0.22.2 → 0.22.3
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/cookie.rb +14 -3
- data/lib/protocol/http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae0619e142c0e086b69d661ba9ae444330f52170bec2baff74241c7f49a906ba
|
4
|
+
data.tar.gz: 6b9b328ea74065aa14d07ba55d7f16bb5890b8df98162991cd17e92050bfaf4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 216e6bb9c9b9f399c12b4f1e8c49f62ea2d9f2529e16249554159ab09b64d6eb84630235d2ad8c01344881509f9c4920aaa8c0ba5c5e0894d928623a2c43ea0b
|
7
|
+
data.tar.gz: 3faf9365436e8b233047ee3b5a7c4393de83e31ca06c5b195e1ac7e97751b619bffaebd52c9351e02697fe9669b2f9a32514a8abdc3f0d0df5594a296aaddd39
|
data/lib/protocol/http/cookie.rb
CHANGED
@@ -32,6 +32,10 @@ module Protocol
|
|
32
32
|
@directives = directives
|
33
33
|
end
|
34
34
|
|
35
|
+
attr :name
|
36
|
+
attr :value
|
37
|
+
attr :directives
|
38
|
+
|
35
39
|
def encoded_name
|
36
40
|
URL.escape(@name)
|
37
41
|
end
|
@@ -61,11 +65,11 @@ module Protocol
|
|
61
65
|
return buffer
|
62
66
|
end
|
63
67
|
|
64
|
-
def self.parse
|
65
|
-
head, *
|
68
|
+
def self.parse(string)
|
69
|
+
head, *directives = string.split(/\s*;\s*/)
|
66
70
|
|
67
71
|
key, value = head.split('=')
|
68
|
-
directives
|
72
|
+
directives = self.parse_directives(directives)
|
69
73
|
|
70
74
|
self.new(
|
71
75
|
URI.decode(key),
|
@@ -73,6 +77,13 @@ module Protocol
|
|
73
77
|
directives,
|
74
78
|
)
|
75
79
|
end
|
80
|
+
|
81
|
+
def self.parse_directives(strings)
|
82
|
+
strings.collect do |string|
|
83
|
+
key, value = string.split('=', 2)
|
84
|
+
[key, value || true]
|
85
|
+
end.to_h
|
86
|
+
end
|
76
87
|
end
|
77
88
|
end
|
78
89
|
end
|
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.22.
|
4
|
+
version: 0.22.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
115
|
+
rubygems_version: 3.1.6
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Provides abstractions to handle HTTP protocols.
|