http 4.2.0 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +65 -0
- data/.gitignore +6 -10
- data/.rspec +0 -4
- data/.rubocop/layout.yml +8 -0
- data/.rubocop/style.yml +32 -0
- data/.rubocop.yml +8 -110
- data/.rubocop_todo.yml +192 -0
- data/.yardopts +1 -1
- data/CHANGES.md +168 -0
- data/Gemfile +18 -10
- data/LICENSE.txt +1 -1
- data/README.md +17 -20
- data/Rakefile +2 -10
- data/http.gemspec +5 -5
- data/lib/http/chainable.rb +23 -17
- data/lib/http/client.rb +52 -35
- data/lib/http/connection.rb +12 -8
- data/lib/http/content_type.rb +12 -7
- data/lib/http/feature.rb +3 -1
- data/lib/http/features/auto_deflate.rb +7 -7
- data/lib/http/features/auto_inflate.rb +6 -7
- data/lib/http/features/instrumentation.rb +1 -1
- data/lib/http/features/logging.rb +19 -21
- data/lib/http/headers.rb +50 -13
- data/lib/http/mime_type/adapter.rb +3 -1
- data/lib/http/mime_type/json.rb +1 -0
- data/lib/http/options.rb +6 -9
- data/lib/http/redirector.rb +4 -2
- data/lib/http/request/body.rb +1 -0
- data/lib/http/request/writer.rb +8 -3
- data/lib/http/request.rb +28 -11
- data/lib/http/response/body.rb +6 -4
- data/lib/http/response/inflater.rb +1 -1
- data/lib/http/response/parser.rb +75 -49
- data/lib/http/response/status.rb +4 -3
- data/lib/http/response.rb +35 -15
- data/lib/http/timeout/global.rb +42 -38
- data/lib/http/timeout/null.rb +2 -1
- data/lib/http/timeout/per_operation.rb +56 -58
- data/lib/http/uri.rb +5 -5
- data/lib/http/version.rb +1 -1
- data/spec/lib/http/client_spec.rb +173 -35
- data/spec/lib/http/connection_spec.rb +8 -5
- data/spec/lib/http/features/auto_inflate_spec.rb +3 -2
- data/spec/lib/http/features/instrumentation_spec.rb +27 -21
- data/spec/lib/http/features/logging_spec.rb +8 -10
- data/spec/lib/http/headers_spec.rb +53 -18
- data/spec/lib/http/options/headers_spec.rb +1 -1
- data/spec/lib/http/options/merge_spec.rb +16 -16
- data/spec/lib/http/redirector_spec.rb +59 -1
- data/spec/lib/http/request/writer_spec.rb +25 -2
- data/spec/lib/http/request_spec.rb +5 -5
- data/spec/lib/http/response/body_spec.rb +5 -5
- data/spec/lib/http/response/parser_spec.rb +74 -0
- data/spec/lib/http/response/status_spec.rb +3 -3
- data/spec/lib/http/response_spec.rb +44 -3
- data/spec/lib/http_spec.rb +30 -3
- data/spec/spec_helper.rb +21 -21
- data/spec/support/black_hole.rb +1 -1
- data/spec/support/dummy_server/servlet.rb +17 -6
- data/spec/support/dummy_server.rb +7 -7
- data/spec/support/fuubar.rb +21 -0
- data/spec/support/http_handling_shared.rb +4 -4
- data/spec/support/simplecov.rb +19 -0
- data/spec/support/ssl_helper.rb +4 -4
- metadata +24 -16
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -37
data/spec/support/ssl_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require "pathname"
|
|
5
5
|
require "certificate_authority"
|
6
6
|
|
7
7
|
module SSLHelper
|
8
|
-
CERTS_PATH = Pathname.new File.expand_path("
|
8
|
+
CERTS_PATH = Pathname.new File.expand_path("../../tmp/certs", __dir__)
|
9
9
|
|
10
10
|
class RootCertificate < ::CertificateAuthority::Certificate
|
11
11
|
EXTENSIONS = {"keyUsage" => {"usage" => %w[critical keyCertSign]}}.freeze
|
@@ -83,14 +83,14 @@ module SSLHelper
|
|
83
83
|
|
84
84
|
def client_params
|
85
85
|
{
|
86
|
-
:key
|
87
|
-
:cert
|
86
|
+
:key => client_cert.key,
|
87
|
+
:cert => client_cert.cert,
|
88
88
|
:ca_file => ca.file
|
89
89
|
}
|
90
90
|
end
|
91
91
|
|
92
92
|
%w[server client].each do |side|
|
93
|
-
class_eval <<-RUBY, __FILE__, __LINE__
|
93
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
94
94
|
def #{side}_cert
|
95
95
|
@#{side}_cert ||= ChildCertificate.new ca
|
96
96
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
- Erik Michaels-Ober
|
9
9
|
- Alexey V. Zapparov
|
10
10
|
- Zachary Anker
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: addressable
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '2.
|
22
|
+
version: '2.8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '2.
|
29
|
+
version: '2.8'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: http-cookie
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,28 +47,28 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '2.
|
50
|
+
version: '2.2'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '2.
|
57
|
+
version: '2.2'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
59
|
+
name: llhttp-ffi
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: 0.4.0
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - "~>"
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
71
|
+
version: 0.4.0
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: bundler
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,11 +91,13 @@ executables: []
|
|
91
91
|
extensions: []
|
92
92
|
extra_rdoc_files: []
|
93
93
|
files:
|
94
|
-
- ".
|
94
|
+
- ".github/workflows/ci.yml"
|
95
95
|
- ".gitignore"
|
96
96
|
- ".rspec"
|
97
97
|
- ".rubocop.yml"
|
98
|
-
- ".
|
98
|
+
- ".rubocop/layout.yml"
|
99
|
+
- ".rubocop/style.yml"
|
100
|
+
- ".rubocop_todo.yml"
|
99
101
|
- ".yardopts"
|
100
102
|
- CHANGES.md
|
101
103
|
- CONTRIBUTING.md
|
@@ -163,6 +165,7 @@ files:
|
|
163
165
|
- spec/lib/http/request/writer_spec.rb
|
164
166
|
- spec/lib/http/request_spec.rb
|
165
167
|
- spec/lib/http/response/body_spec.rb
|
168
|
+
- spec/lib/http/response/parser_spec.rb
|
166
169
|
- spec/lib/http/response/status_spec.rb
|
167
170
|
- spec/lib/http/response_spec.rb
|
168
171
|
- spec/lib/http/uri_spec.rb
|
@@ -174,10 +177,12 @@ files:
|
|
174
177
|
- spec/support/dummy_server.rb
|
175
178
|
- spec/support/dummy_server/servlet.rb
|
176
179
|
- spec/support/fakeio.rb
|
180
|
+
- spec/support/fuubar.rb
|
177
181
|
- spec/support/http_handling_shared.rb
|
178
182
|
- spec/support/proxy_server.rb
|
179
183
|
- spec/support/servers/config.rb
|
180
184
|
- spec/support/servers/runner.rb
|
185
|
+
- spec/support/simplecov.rb
|
181
186
|
- spec/support/ssl_helper.rb
|
182
187
|
homepage: https://github.com/httprb/http
|
183
188
|
licenses:
|
@@ -186,8 +191,8 @@ metadata:
|
|
186
191
|
source_code_uri: https://github.com/httprb/http
|
187
192
|
wiki_uri: https://github.com/httprb/http/wiki
|
188
193
|
bug_tracker_uri: https://github.com/httprb/http/issues
|
189
|
-
changelog_uri: https://github.com/httprb/http/blob/
|
190
|
-
post_install_message:
|
194
|
+
changelog_uri: https://github.com/httprb/http/blob/v5.0.2/CHANGES.md
|
195
|
+
post_install_message:
|
191
196
|
rdoc_options: []
|
192
197
|
require_paths:
|
193
198
|
- lib
|
@@ -195,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
195
200
|
requirements:
|
196
201
|
- - ">="
|
197
202
|
- !ruby/object:Gem::Version
|
198
|
-
version: '2.
|
203
|
+
version: '2.5'
|
199
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
205
|
requirements:
|
201
206
|
- - ">="
|
@@ -203,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
208
|
version: '0'
|
204
209
|
requirements: []
|
205
210
|
rubygems_version: 3.0.3
|
206
|
-
signing_key:
|
211
|
+
signing_key:
|
207
212
|
specification_version: 4
|
208
213
|
summary: HTTP should be easy
|
209
214
|
test_files:
|
@@ -230,6 +235,7 @@ test_files:
|
|
230
235
|
- spec/lib/http/request/writer_spec.rb
|
231
236
|
- spec/lib/http/request_spec.rb
|
232
237
|
- spec/lib/http/response/body_spec.rb
|
238
|
+
- spec/lib/http/response/parser_spec.rb
|
233
239
|
- spec/lib/http/response/status_spec.rb
|
234
240
|
- spec/lib/http/response_spec.rb
|
235
241
|
- spec/lib/http/uri_spec.rb
|
@@ -241,8 +247,10 @@ test_files:
|
|
241
247
|
- spec/support/dummy_server.rb
|
242
248
|
- spec/support/dummy_server/servlet.rb
|
243
249
|
- spec/support/fakeio.rb
|
250
|
+
- spec/support/fuubar.rb
|
244
251
|
- spec/support/http_handling_shared.rb
|
245
252
|
- spec/support/proxy_server.rb
|
246
253
|
- spec/support/servers/config.rb
|
247
254
|
- spec/support/servers/runner.rb
|
255
|
+
- spec/support/simplecov.rb
|
248
256
|
- spec/support/ssl_helper.rb
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service-name: travis-pro
|
data/.travis.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
|
4
|
-
cache: bundler
|
5
|
-
|
6
|
-
before_install:
|
7
|
-
- gem update --system
|
8
|
-
- gem --version
|
9
|
-
- gem install bundler
|
10
|
-
- bundle --version
|
11
|
-
|
12
|
-
install: bundle install --without development doc
|
13
|
-
|
14
|
-
script: bundle exec rake
|
15
|
-
|
16
|
-
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
17
|
-
|
18
|
-
rvm:
|
19
|
-
# Include JRuby first because it takes the longest
|
20
|
-
- jruby-9.2.5.0
|
21
|
-
- 2.3
|
22
|
-
- 2.4
|
23
|
-
- 2.5
|
24
|
-
- 2.6
|
25
|
-
|
26
|
-
matrix:
|
27
|
-
fast_finish: true
|
28
|
-
include:
|
29
|
-
# Only run RuboCop and Yardstick metrics on the latest Ruby
|
30
|
-
- rvm: 2.6
|
31
|
-
env: SUITE="rubocop"
|
32
|
-
- rvm: 2.6
|
33
|
-
env: SUITE="yardstick"
|
34
|
-
|
35
|
-
branches:
|
36
|
-
only:
|
37
|
-
- master
|