protocol-http 0.23.12 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/design.md +167 -0
- data/lib/protocol/http/accept_encoding.rb +5 -20
- data/lib/protocol/http/body/buffered.rb +3 -19
- data/lib/protocol/http/body/completable.rb +2 -19
- data/lib/protocol/http/body/deflate.rb +3 -30
- data/lib/protocol/http/body/digestable.rb +9 -21
- data/lib/protocol/http/body/file.rb +4 -21
- data/lib/protocol/http/body/head.rb +3 -20
- data/lib/protocol/http/body/inflate.rb +8 -22
- data/lib/protocol/http/body/readable.rb +6 -23
- data/lib/protocol/http/body/reader.rb +5 -21
- data/lib/protocol/http/body/rewindable.rb +2 -19
- data/lib/protocol/http/body/stream.rb +6 -23
- data/lib/protocol/http/body/wrapper.rb +2 -19
- data/lib/protocol/http/content_encoding.rb +2 -19
- data/lib/protocol/http/cookie.rb +3 -19
- data/lib/protocol/http/error.rb +2 -19
- data/lib/protocol/http/header/authorization.rb +2 -19
- data/lib/protocol/http/header/cache_control.rb +4 -21
- data/lib/protocol/http/header/connection.rb +4 -21
- data/lib/protocol/http/header/cookie.rb +2 -19
- data/lib/protocol/http/header/etag.rb +3 -20
- data/lib/protocol/http/header/etags.rb +2 -19
- data/lib/protocol/http/header/multiple.rb +2 -19
- data/lib/protocol/http/header/split.rb +8 -21
- data/lib/protocol/http/header/vary.rb +2 -19
- data/lib/protocol/http/headers.rb +12 -19
- data/lib/protocol/http/methods.rb +2 -19
- data/lib/protocol/http/middleware/builder.rb +2 -19
- data/lib/protocol/http/middleware.rb +2 -19
- data/lib/protocol/http/reference.rb +77 -69
- data/lib/protocol/http/request.rb +3 -20
- data/lib/protocol/http/response.rb +10 -20
- data/lib/protocol/http/url.rb +4 -20
- data/lib/protocol/http/version.rb +3 -20
- data/lib/protocol/http.rb +2 -19
- data/license.md +27 -0
- data/readme.md +32 -0
- data.tar.gz.sig +0 -0
- metadata +8 -3
- metadata.gz.sig +0 -0
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2018-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'url'
|
24
7
|
|
@@ -31,14 +14,14 @@ module Protocol
|
|
31
14
|
# Generate a reference from a path and user parameters. The path may contain a `#fragment` or `?query=parameters`.
|
32
15
|
def self.parse(path = '/', parameters = nil)
|
33
16
|
base, fragment = path.split('#', 2)
|
34
|
-
path,
|
17
|
+
path, query = base.split('?', 2)
|
35
18
|
|
36
|
-
self.new(path,
|
19
|
+
self.new(path, query, fragment, parameters)
|
37
20
|
end
|
38
21
|
|
39
|
-
def initialize(path = '/',
|
22
|
+
def initialize(path = '/', query = nil, fragment = nil, parameters = nil)
|
40
23
|
@path = path
|
41
|
-
@
|
24
|
+
@query = query
|
42
25
|
@fragment = fragment
|
43
26
|
@parameters = parameters
|
44
27
|
end
|
@@ -47,7 +30,7 @@ module Protocol
|
|
47
30
|
attr_accessor :path
|
48
31
|
|
49
32
|
# The un-parsed query string, e.g. 'x=10&y=20'
|
50
|
-
attr_accessor :
|
33
|
+
attr_accessor :query
|
51
34
|
|
52
35
|
# A fragment, the part after the '#'
|
53
36
|
attr_accessor :fragment
|
@@ -59,7 +42,7 @@ module Protocol
|
|
59
42
|
return self if frozen?
|
60
43
|
|
61
44
|
@path.freeze
|
62
|
-
@
|
45
|
+
@query.freeze
|
63
46
|
@fragment.freeze
|
64
47
|
@parameters.freeze
|
65
48
|
|
@@ -67,7 +50,7 @@ module Protocol
|
|
67
50
|
end
|
68
51
|
|
69
52
|
def to_ary
|
70
|
-
[@path, @
|
53
|
+
[@path, @query, @fragment, @parameters]
|
71
54
|
end
|
72
55
|
|
73
56
|
def <=> other
|
@@ -86,8 +69,8 @@ module Protocol
|
|
86
69
|
@parameters and !@parameters.empty?
|
87
70
|
end
|
88
71
|
|
89
|
-
def
|
90
|
-
@
|
72
|
+
def query?
|
73
|
+
@query and !@query.empty?
|
91
74
|
end
|
92
75
|
|
93
76
|
def fragment?
|
@@ -95,8 +78,8 @@ module Protocol
|
|
95
78
|
end
|
96
79
|
|
97
80
|
def append(buffer)
|
98
|
-
if
|
99
|
-
buffer << URL.escape_path(@path) << '?' << @
|
81
|
+
if query?
|
82
|
+
buffer << URL.escape_path(@path) << '?' << @query
|
100
83
|
buffer << '&' << URL.encode(@parameters) if parameters?
|
101
84
|
else
|
102
85
|
buffer << URL.escape_path(@path)
|
@@ -120,7 +103,7 @@ module Protocol
|
|
120
103
|
|
121
104
|
self.class.new(
|
122
105
|
expand_path(self.path, other.path, true),
|
123
|
-
other.
|
106
|
+
other.query,
|
124
107
|
other.fragment,
|
125
108
|
other.parameters,
|
126
109
|
)
|
@@ -131,34 +114,34 @@ module Protocol
|
|
131
114
|
self.class.new(@path, nil, nil, nil)
|
132
115
|
end
|
133
116
|
|
134
|
-
#
|
135
|
-
# @
|
136
|
-
# @
|
137
|
-
|
117
|
+
# Update the reference with the given path, parameters and fragment.
|
118
|
+
# @argument path [String] Append the string to this reference similar to `File.join`.
|
119
|
+
# @argument parameters [Hash] Append the parameters to this reference.
|
120
|
+
# @argument fragment [String] Set the fragment to this value.
|
121
|
+
# @argument pop [Boolean] If the path contains a trailing filename, pop the last component of the path before appending the new path.
|
122
|
+
# @argument merge [Boolean] If the parameters are specified, merge them with the existing parameters.
|
123
|
+
def with(path: nil, parameters: nil, fragment: @fragment, pop: true, merge: true)
|
138
124
|
if @parameters
|
139
|
-
if parameters
|
125
|
+
if parameters and merge
|
140
126
|
parameters = @parameters.merge(parameters)
|
141
127
|
else
|
142
128
|
parameters = @parameters
|
143
129
|
end
|
144
130
|
end
|
145
131
|
|
146
|
-
if
|
147
|
-
|
132
|
+
if @query and !merge
|
133
|
+
query = nil
|
148
134
|
else
|
149
|
-
|
135
|
+
query = @query
|
150
136
|
end
|
151
137
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
# The arguments to this function are legacy, prefer to use `with`.
|
156
|
-
def dup(path = nil, parameters = nil, merge_parameters = true)
|
157
|
-
if merge_parameters
|
158
|
-
with(path: path, parameters: parameters)
|
138
|
+
if path
|
139
|
+
path = expand_path(@path, path, pop)
|
159
140
|
else
|
160
|
-
|
141
|
+
path = @path
|
161
142
|
end
|
143
|
+
|
144
|
+
self.class.new(path, query, fragment, parameters)
|
162
145
|
end
|
163
146
|
|
164
147
|
private
|
@@ -171,33 +154,58 @@ module Protocol
|
|
171
154
|
end
|
172
155
|
end
|
173
156
|
|
157
|
+
def expand_absolute_path(path, parts)
|
158
|
+
parts.each do |part|
|
159
|
+
if part == '..'
|
160
|
+
path.pop
|
161
|
+
elsif part == '.'
|
162
|
+
# Do nothing.
|
163
|
+
else
|
164
|
+
path << part
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
if path.first != ''
|
169
|
+
path.unshift('')
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def expand_relative_path(path, parts)
|
174
|
+
parts.each do |part|
|
175
|
+
if part == '..' and path.any?
|
176
|
+
path.pop
|
177
|
+
elsif part == '.'
|
178
|
+
# Do nothing.
|
179
|
+
else
|
180
|
+
path << part
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
174
185
|
# @param pop [Boolean] whether to remove the last path component of the base path, to conform to URI merging behaviour, as defined by RFC2396.
|
175
186
|
def expand_path(base, relative, pop = true)
|
176
187
|
if relative.start_with? '/'
|
177
188
|
return relative
|
178
|
-
else
|
179
|
-
path = split(base)
|
180
|
-
|
181
|
-
# RFC2396 Section 5.2:
|
182
|
-
# 6) a) All but the last segment of the base URI's path component is
|
183
|
-
# copied to the buffer. In other words, any characters after the
|
184
|
-
# last (right-most) slash character, if any, are excluded.
|
185
|
-
path.pop if pop or path.last == ''
|
186
|
-
|
187
|
-
parts = split(relative)
|
188
|
-
|
189
|
-
parts.each do |part|
|
190
|
-
if part == '..'
|
191
|
-
path.pop
|
192
|
-
elsif part == '.'
|
193
|
-
# Do nothing.
|
194
|
-
else
|
195
|
-
path << part
|
196
|
-
end
|
197
|
-
end
|
198
|
-
|
199
|
-
return path.join('/')
|
200
189
|
end
|
190
|
+
|
191
|
+
path = split(base)
|
192
|
+
|
193
|
+
# RFC2396 Section 5.2:
|
194
|
+
# 6) a) All but the last segment of the base URI's path component is
|
195
|
+
# copied to the buffer. In other words, any characters after the
|
196
|
+
# last (right-most) slash character, if any, are excluded.
|
197
|
+
path.pop if pop or path.last == ''
|
198
|
+
|
199
|
+
parts = split(relative)
|
200
|
+
|
201
|
+
# Absolute path:
|
202
|
+
if path.first == ''
|
203
|
+
expand_absolute_path(path, parts)
|
204
|
+
else
|
205
|
+
expand_relative_path(path, parts)
|
206
|
+
end
|
207
|
+
|
208
|
+
return path.join('/')
|
201
209
|
end
|
202
210
|
end
|
203
211
|
end
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'body/buffered'
|
24
7
|
require_relative 'body/reader'
|
@@ -79,7 +62,7 @@ module Protocol
|
|
79
62
|
@method == Methods::CONNECT
|
80
63
|
end
|
81
64
|
|
82
|
-
def self.[](method, path, headers, body)
|
65
|
+
def self.[](method, path, headers = nil, body = nil)
|
83
66
|
body = Body::Buffered.wrap(body)
|
84
67
|
headers = ::Protocol::HTTP::Headers[headers]
|
85
68
|
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'body/buffered'
|
24
7
|
require_relative 'body/reader'
|
@@ -50,6 +33,10 @@ module Protocol
|
|
50
33
|
@status == 100
|
51
34
|
end
|
52
35
|
|
36
|
+
def ok?
|
37
|
+
@status == 200
|
38
|
+
end
|
39
|
+
|
53
40
|
def success?
|
54
41
|
@status and @status >= 200 && @status < 300
|
55
42
|
end
|
@@ -78,10 +65,13 @@ module Protocol
|
|
78
65
|
@status == 400
|
79
66
|
end
|
80
67
|
|
81
|
-
def
|
68
|
+
def internal_server_error?
|
82
69
|
@status == 500
|
83
70
|
end
|
84
71
|
|
72
|
+
# @deprecated Use {#internal_server_error?} instead.
|
73
|
+
alias server_failure? internal_server_error?
|
74
|
+
|
85
75
|
def self.[](status, headers = nil, body = nil, protocol = nil)
|
86
76
|
body = Body::Buffered.wrap(body)
|
87
77
|
headers = ::Protocol::HTTP::Headers[headers]
|
data/lib/protocol/http/url.rb
CHANGED
@@ -1,24 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2023, by Samuel Williams.
|
5
|
+
# Copyright, 2022, by Herrick Fang.
|
22
6
|
|
23
7
|
module Protocol
|
24
8
|
module HTTP
|
@@ -76,7 +60,7 @@ module Protocol
|
|
76
60
|
string.split('&') do |assignment|
|
77
61
|
key, value = assignment.split('=', 2)
|
78
62
|
|
79
|
-
yield unescape(key), unescape(value)
|
63
|
+
yield unescape(key), value.nil? ? value : unescape(value)
|
80
64
|
end
|
81
65
|
end
|
82
66
|
|
@@ -1,27 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2018-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
module Protocol
|
24
7
|
module HTTP
|
25
|
-
VERSION = "0.
|
8
|
+
VERSION = "0.24.0"
|
26
9
|
end
|
27
10
|
end
|
data/lib/protocol/http.rb
CHANGED
@@ -1,23 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2018-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative "http/version"
|
data/license.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2018-2023, by Samuel Williams.
|
4
|
+
Copyright, 2019, by Yuta Iwama.
|
5
|
+
Copyright, 2020, by Olle Jonsson.
|
6
|
+
Copyright, 2020, by Bryan Powell.
|
7
|
+
Copyright, 2020, by Bruno Sutic.
|
8
|
+
Copyright, 2022, by Herrick Fang.
|
9
|
+
Copyright, 2022, by Dan Olson.
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
13
|
+
in the Software without restriction, including without limitation the rights
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
16
|
+
furnished to do so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Protocol::HTTP
|
2
|
+
|
3
|
+
Provides abstractions for working with the HTTP protocol.
|
4
|
+
|
5
|
+
[![Development Status](https://github.com/socketry/protocol-http/workflows/Test/badge.svg)](https://github.com/socketry/protocol-http/actions?workflow=Test)
|
6
|
+
|
7
|
+
## Features
|
8
|
+
|
9
|
+
- General abstractions for HTTP requests and responses.
|
10
|
+
- Symmetrical interfaces for client and server.
|
11
|
+
- Light-weight middlewar model for building applications.
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Please see the [project documentation](https://socketry.github.io/protocol-http).
|
16
|
+
|
17
|
+
## Contributing
|
18
|
+
|
19
|
+
We welcome contributions to this project.
|
20
|
+
|
21
|
+
1. Fork it.
|
22
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
23
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
24
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
25
|
+
5. Create new Pull Request.
|
26
|
+
|
27
|
+
## See Also
|
28
|
+
|
29
|
+
- [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this interface.
|
30
|
+
- [protocol-http2](https://github.com/socketry/protocol-http2) — HTTP/2 client/server implementation using this interface.
|
31
|
+
- [async-http](https://github.com/socketry/async-http) — Asynchronous HTTP client and server, supporting multiple HTTP protocols & TLS.
|
32
|
+
- [async-websocket](https://github.com/socketry/async-websocket) — Asynchronous client and server WebSockets.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
+
- Herrick Fang
|
8
9
|
- Bruno Sutic
|
9
10
|
- Bryan Powell
|
11
|
+
- Dan Olson
|
10
12
|
- Olle Jonsson
|
11
13
|
- Yuta Iwama
|
12
14
|
autorequire:
|
@@ -41,7 +43,7 @@ cert_chain:
|
|
41
43
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
42
44
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
43
45
|
-----END CERTIFICATE-----
|
44
|
-
date:
|
46
|
+
date: 2023-01-28 00:00:00.000000000 Z
|
45
47
|
dependencies:
|
46
48
|
- !ruby/object:Gem::Dependency
|
47
49
|
name: bundler
|
@@ -91,6 +93,7 @@ executables: []
|
|
91
93
|
extensions: []
|
92
94
|
extra_rdoc_files: []
|
93
95
|
files:
|
96
|
+
- design.md
|
94
97
|
- lib/protocol/http.rb
|
95
98
|
- lib/protocol/http/accept_encoding.rb
|
96
99
|
- lib/protocol/http/body/buffered.rb
|
@@ -126,6 +129,8 @@ files:
|
|
126
129
|
- lib/protocol/http/response.rb
|
127
130
|
- lib/protocol/http/url.rb
|
128
131
|
- lib/protocol/http/version.rb
|
132
|
+
- license.md
|
133
|
+
- readme.md
|
129
134
|
homepage: https://github.com/socketry/protocol-http
|
130
135
|
licenses:
|
131
136
|
- MIT
|
@@ -145,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
150
|
- !ruby/object:Gem::Version
|
146
151
|
version: '0'
|
147
152
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.4.1
|
149
154
|
signing_key:
|
150
155
|
specification_version: 4
|
151
156
|
summary: Provides abstractions to handle HTTP protocols.
|
metadata.gz.sig
CHANGED
Binary file
|