http 5.3.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +241 -41
- data/LICENSE.txt +1 -1
- data/README.md +110 -13
- data/UPGRADING.md +491 -0
- data/http.gemspec +32 -29
- data/lib/http/base64.rb +11 -1
- data/lib/http/chainable/helpers.rb +62 -0
- data/lib/http/chainable/verbs.rb +136 -0
- data/lib/http/chainable.rb +232 -136
- data/lib/http/client.rb +158 -127
- data/lib/http/connection/internals.rb +141 -0
- data/lib/http/connection.rb +126 -97
- data/lib/http/content_type.rb +61 -6
- data/lib/http/errors.rb +25 -1
- data/lib/http/feature.rb +65 -5
- data/lib/http/features/auto_deflate.rb +124 -17
- data/lib/http/features/auto_inflate.rb +38 -15
- data/lib/http/features/caching/entry.rb +178 -0
- data/lib/http/features/caching/in_memory_store.rb +63 -0
- data/lib/http/features/caching.rb +216 -0
- data/lib/http/features/digest_auth.rb +234 -0
- data/lib/http/features/instrumentation.rb +97 -17
- data/lib/http/features/logging.rb +183 -5
- data/lib/http/features/normalize_uri.rb +17 -0
- data/lib/http/features/raise_error.rb +18 -3
- data/lib/http/form_data/composite_io.rb +106 -0
- data/lib/http/form_data/file.rb +95 -0
- data/lib/http/form_data/multipart/param.rb +62 -0
- data/lib/http/form_data/multipart.rb +106 -0
- data/lib/http/form_data/part.rb +52 -0
- data/lib/http/form_data/readable.rb +58 -0
- data/lib/http/form_data/urlencoded.rb +175 -0
- data/lib/http/form_data/version.rb +8 -0
- data/lib/http/form_data.rb +102 -0
- data/lib/http/headers/known.rb +3 -0
- data/lib/http/headers/normalizer.rb +17 -36
- data/lib/http/headers.rb +172 -65
- data/lib/http/mime_type/adapter.rb +24 -9
- data/lib/http/mime_type/json.rb +19 -4
- data/lib/http/mime_type.rb +21 -3
- data/lib/http/options/definitions.rb +189 -0
- data/lib/http/options.rb +172 -125
- data/lib/http/redirector.rb +80 -75
- data/lib/http/request/body.rb +87 -6
- data/lib/http/request/builder.rb +184 -0
- data/lib/http/request/proxy.rb +83 -0
- data/lib/http/request/writer.rb +76 -16
- data/lib/http/request.rb +214 -98
- data/lib/http/response/body.rb +103 -18
- data/lib/http/response/inflater.rb +35 -7
- data/lib/http/response/parser.rb +98 -4
- data/lib/http/response/status/reasons.rb +2 -4
- data/lib/http/response/status.rb +141 -31
- data/lib/http/response.rb +219 -61
- data/lib/http/retriable/delay_calculator.rb +38 -11
- data/lib/http/retriable/errors.rb +21 -0
- data/lib/http/retriable/performer.rb +82 -38
- data/lib/http/session.rb +280 -0
- data/lib/http/timeout/global.rb +147 -34
- data/lib/http/timeout/null.rb +155 -9
- data/lib/http/timeout/per_operation.rb +139 -18
- data/lib/http/uri/normalizer.rb +82 -0
- data/lib/http/uri/parsing.rb +182 -0
- data/lib/http/uri.rb +289 -124
- data/lib/http/version.rb +2 -1
- data/lib/http.rb +11 -2
- data/sig/deps.rbs +122 -0
- data/sig/http.rbs +1619 -0
- data/test/http/base64_test.rb +28 -0
- data/test/http/client_test.rb +739 -0
- data/test/http/connection_test.rb +1533 -0
- data/test/http/content_type_test.rb +190 -0
- data/test/http/errors_test.rb +28 -0
- data/test/http/feature_test.rb +49 -0
- data/test/http/features/auto_deflate_test.rb +317 -0
- data/test/http/features/auto_inflate_test.rb +213 -0
- data/test/http/features/caching_test.rb +942 -0
- data/test/http/features/digest_auth_test.rb +996 -0
- data/test/http/features/instrumentation_test.rb +246 -0
- data/test/http/features/logging_test.rb +654 -0
- data/test/http/features/normalize_uri_test.rb +41 -0
- data/test/http/features/raise_error_test.rb +77 -0
- data/test/http/form_data/composite_io_test.rb +215 -0
- data/test/http/form_data/file_test.rb +255 -0
- data/test/http/form_data/fixtures/the-http-gem.info +1 -0
- data/test/http/form_data/multipart_test.rb +303 -0
- data/test/http/form_data/part_test.rb +90 -0
- data/test/http/form_data/urlencoded_test.rb +164 -0
- data/test/http/form_data_test.rb +232 -0
- data/test/http/headers/normalizer_test.rb +93 -0
- data/test/http/headers_test.rb +888 -0
- data/test/http/mime_type/json_test.rb +39 -0
- data/test/http/mime_type_test.rb +150 -0
- data/test/http/options/base_uri_test.rb +148 -0
- data/test/http/options/body_test.rb +21 -0
- data/test/http/options/features_test.rb +38 -0
- data/test/http/options/form_test.rb +21 -0
- data/test/http/options/headers_test.rb +32 -0
- data/test/http/options/json_test.rb +21 -0
- data/test/http/options/merge_test.rb +78 -0
- data/test/http/options/new_test.rb +37 -0
- data/test/http/options/proxy_test.rb +32 -0
- data/test/http/options_test.rb +575 -0
- data/test/http/redirector_test.rb +639 -0
- data/test/http/request/body_test.rb +318 -0
- data/test/http/request/builder_test.rb +623 -0
- data/test/http/request/writer_test.rb +391 -0
- data/test/http/request_test.rb +1733 -0
- data/test/http/response/body_test.rb +292 -0
- data/test/http/response/parser_test.rb +105 -0
- data/test/http/response/status_test.rb +322 -0
- data/test/http/response_test.rb +502 -0
- data/test/http/retriable/delay_calculator_test.rb +194 -0
- data/test/http/retriable/errors_test.rb +71 -0
- data/test/http/retriable/performer_test.rb +551 -0
- data/test/http/session_test.rb +424 -0
- data/test/http/timeout/global_test.rb +239 -0
- data/test/http/timeout/null_test.rb +218 -0
- data/test/http/timeout/per_operation_test.rb +220 -0
- data/test/http/uri/normalizer_test.rb +89 -0
- data/test/http/uri_test.rb +1140 -0
- data/test/http/version_test.rb +15 -0
- data/test/http_test.rb +818 -0
- data/test/regression_tests.rb +27 -0
- data/test/support/dummy_server/encoding_routes.rb +47 -0
- data/test/support/dummy_server/routes.rb +201 -0
- data/test/support/dummy_server/servlet.rb +81 -0
- data/test/support/dummy_server.rb +200 -0
- data/{spec → test}/support/fakeio.rb +2 -2
- data/test/support/http_handling_shared/connection_reuse_tests.rb +97 -0
- data/test/support/http_handling_shared/timeout_tests.rb +134 -0
- data/test/support/http_handling_shared.rb +11 -0
- data/test/support/proxy_server.rb +207 -0
- data/test/support/servers/runner.rb +67 -0
- data/{spec → test}/support/simplecov.rb +11 -2
- data/test/support/ssl_helper.rb +108 -0
- data/test/test_helper.rb +38 -0
- metadata +108 -168
- data/.github/workflows/ci.yml +0 -67
- data/.gitignore +0 -15
- data/.rspec +0 -1
- data/.rubocop/layout.yml +0 -8
- data/.rubocop/metrics.yml +0 -4
- data/.rubocop/rspec.yml +0 -9
- data/.rubocop/style.yml +0 -32
- data/.rubocop.yml +0 -11
- data/.rubocop_todo.yml +0 -219
- data/.yardopts +0 -2
- data/CHANGES_OLD.md +0 -1002
- data/Gemfile +0 -51
- data/Guardfile +0 -18
- data/Rakefile +0 -64
- data/lib/http/headers/mixin.rb +0 -34
- data/lib/http/retriable/client.rb +0 -37
- data/logo.png +0 -0
- data/spec/lib/http/client_spec.rb +0 -556
- data/spec/lib/http/connection_spec.rb +0 -88
- data/spec/lib/http/content_type_spec.rb +0 -47
- data/spec/lib/http/features/auto_deflate_spec.rb +0 -77
- data/spec/lib/http/features/auto_inflate_spec.rb +0 -86
- data/spec/lib/http/features/instrumentation_spec.rb +0 -81
- data/spec/lib/http/features/logging_spec.rb +0 -65
- data/spec/lib/http/features/raise_error_spec.rb +0 -62
- data/spec/lib/http/headers/mixin_spec.rb +0 -36
- data/spec/lib/http/headers/normalizer_spec.rb +0 -52
- data/spec/lib/http/headers_spec.rb +0 -527
- data/spec/lib/http/options/body_spec.rb +0 -15
- data/spec/lib/http/options/features_spec.rb +0 -33
- data/spec/lib/http/options/form_spec.rb +0 -15
- data/spec/lib/http/options/headers_spec.rb +0 -24
- data/spec/lib/http/options/json_spec.rb +0 -15
- data/spec/lib/http/options/merge_spec.rb +0 -68
- data/spec/lib/http/options/new_spec.rb +0 -30
- data/spec/lib/http/options/proxy_spec.rb +0 -20
- data/spec/lib/http/options_spec.rb +0 -13
- data/spec/lib/http/redirector_spec.rb +0 -530
- data/spec/lib/http/request/body_spec.rb +0 -211
- data/spec/lib/http/request/writer_spec.rb +0 -121
- data/spec/lib/http/request_spec.rb +0 -234
- data/spec/lib/http/response/body_spec.rb +0 -85
- data/spec/lib/http/response/parser_spec.rb +0 -74
- data/spec/lib/http/response/status_spec.rb +0 -253
- data/spec/lib/http/response_spec.rb +0 -262
- data/spec/lib/http/retriable/delay_calculator_spec.rb +0 -69
- data/spec/lib/http/retriable/performer_spec.rb +0 -302
- data/spec/lib/http/uri/normalizer_spec.rb +0 -95
- data/spec/lib/http/uri_spec.rb +0 -71
- data/spec/lib/http_spec.rb +0 -535
- data/spec/regression_specs.rb +0 -24
- data/spec/spec_helper.rb +0 -89
- data/spec/support/black_hole.rb +0 -13
- data/spec/support/dummy_server/servlet.rb +0 -203
- data/spec/support/dummy_server.rb +0 -44
- data/spec/support/fuubar.rb +0 -21
- data/spec/support/http_handling_shared.rb +0 -190
- data/spec/support/proxy_server.rb +0 -39
- data/spec/support/servers/config.rb +0 -11
- data/spec/support/servers/runner.rb +0 -19
- data/spec/support/ssl_helper.rb +0 -104
- /data/{spec → test}/support/capture_warning.rb +0 -0
data/.rubocop_todo.yml
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
|
|
3
|
-
# on 2025-06-09 02:44:43 UTC using RuboCop version 1.30.1.
|
|
4
|
-
# The point is for the user to remove these configuration records
|
|
5
|
-
# one by one as the offenses are removed from the code base.
|
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
-
|
|
9
|
-
# Offense count: 1
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: Include.
|
|
12
|
-
# Include: **/*.gemspec
|
|
13
|
-
Gemspec/DeprecatedAttributeAssignment:
|
|
14
|
-
Exclude:
|
|
15
|
-
- 'http.gemspec'
|
|
16
|
-
|
|
17
|
-
# Offense count: 55
|
|
18
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
19
|
-
# Configuration parameters: EnforcedStyle.
|
|
20
|
-
# SupportedStyles: leading, trailing
|
|
21
|
-
Layout/DotPosition:
|
|
22
|
-
Exclude:
|
|
23
|
-
- 'lib/http/options.rb'
|
|
24
|
-
- 'spec/lib/http/client_spec.rb'
|
|
25
|
-
- 'spec/lib/http/features/auto_deflate_spec.rb'
|
|
26
|
-
- 'spec/lib/http/headers_spec.rb'
|
|
27
|
-
- 'spec/lib/http/options/features_spec.rb'
|
|
28
|
-
- 'spec/lib/http/redirector_spec.rb'
|
|
29
|
-
- 'spec/lib/http/response/body_spec.rb'
|
|
30
|
-
- 'spec/lib/http_spec.rb'
|
|
31
|
-
- 'spec/support/http_handling_shared.rb'
|
|
32
|
-
|
|
33
|
-
# Offense count: 2
|
|
34
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
35
|
-
# Configuration parameters: IndentationWidth.
|
|
36
|
-
# SupportedStyles: special_inside_parentheses, consistent, align_braces
|
|
37
|
-
Layout/FirstHashElementIndentation:
|
|
38
|
-
EnforcedStyle: consistent
|
|
39
|
-
|
|
40
|
-
# Offense count: 206
|
|
41
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
42
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
|
43
|
-
# SupportedStyles: space, no_space, compact
|
|
44
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
45
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
46
|
-
Exclude:
|
|
47
|
-
- 'lib/http/chainable.rb'
|
|
48
|
-
- 'spec/lib/http/client_spec.rb'
|
|
49
|
-
- 'spec/lib/http/features/auto_inflate_spec.rb'
|
|
50
|
-
- 'spec/lib/http/features/instrumentation_spec.rb'
|
|
51
|
-
- 'spec/lib/http/features/logging_spec.rb'
|
|
52
|
-
- 'spec/lib/http/headers_spec.rb'
|
|
53
|
-
- 'spec/lib/http/options/features_spec.rb'
|
|
54
|
-
- 'spec/lib/http/options/merge_spec.rb'
|
|
55
|
-
- 'spec/lib/http/options/new_spec.rb'
|
|
56
|
-
- 'spec/lib/http/redirector_spec.rb'
|
|
57
|
-
- 'spec/lib/http/request_spec.rb'
|
|
58
|
-
- 'spec/lib/http/response_spec.rb'
|
|
59
|
-
- 'spec/lib/http_spec.rb'
|
|
60
|
-
- 'spec/support/dummy_server/servlet.rb'
|
|
61
|
-
- 'spec/support/http_handling_shared.rb'
|
|
62
|
-
- 'spec/support/ssl_helper.rb'
|
|
63
|
-
|
|
64
|
-
# Offense count: 4
|
|
65
|
-
Lint/MissingSuper:
|
|
66
|
-
Exclude:
|
|
67
|
-
- 'lib/http/features/auto_deflate.rb'
|
|
68
|
-
- 'lib/http/features/instrumentation.rb'
|
|
69
|
-
- 'lib/http/features/logging.rb'
|
|
70
|
-
- 'lib/http/features/normalize_uri.rb'
|
|
71
|
-
|
|
72
|
-
# Offense count: 1
|
|
73
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
74
|
-
Lint/RedundantCopDisableDirective:
|
|
75
|
-
Exclude:
|
|
76
|
-
- 'spec/lib/http/retriable/performer_spec.rb'
|
|
77
|
-
|
|
78
|
-
# Offense count: 6
|
|
79
|
-
# Configuration parameters: AllowComments, AllowNil.
|
|
80
|
-
Lint/SuppressedException:
|
|
81
|
-
Exclude:
|
|
82
|
-
- 'spec/lib/http/retriable/performer_spec.rb'
|
|
83
|
-
|
|
84
|
-
# Offense count: 8
|
|
85
|
-
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
|
|
86
|
-
Metrics/AbcSize:
|
|
87
|
-
Exclude:
|
|
88
|
-
- 'lib/http/chainable.rb'
|
|
89
|
-
- 'lib/http/client.rb'
|
|
90
|
-
- 'lib/http/connection.rb'
|
|
91
|
-
- 'lib/http/features/auto_deflate.rb'
|
|
92
|
-
- 'lib/http/redirector.rb'
|
|
93
|
-
- 'lib/http/request.rb'
|
|
94
|
-
- 'lib/http/response.rb'
|
|
95
|
-
|
|
96
|
-
# Offense count: 4
|
|
97
|
-
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
98
|
-
Metrics/ClassLength:
|
|
99
|
-
Exclude:
|
|
100
|
-
- 'lib/http/client.rb'
|
|
101
|
-
- 'lib/http/connection.rb'
|
|
102
|
-
- 'lib/http/headers.rb'
|
|
103
|
-
- 'lib/http/request.rb'
|
|
104
|
-
|
|
105
|
-
# Offense count: 2
|
|
106
|
-
# Configuration parameters: IgnoredMethods, Max.
|
|
107
|
-
Metrics/CyclomaticComplexity:
|
|
108
|
-
Exclude:
|
|
109
|
-
- 'lib/http/chainable.rb'
|
|
110
|
-
- 'lib/http/client.rb'
|
|
111
|
-
|
|
112
|
-
# Offense count: 19
|
|
113
|
-
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
114
|
-
Metrics/MethodLength:
|
|
115
|
-
Exclude:
|
|
116
|
-
- 'lib/http/chainable.rb'
|
|
117
|
-
- 'lib/http/client.rb'
|
|
118
|
-
- 'lib/http/connection.rb'
|
|
119
|
-
- 'lib/http/features/auto_deflate.rb'
|
|
120
|
-
- 'lib/http/features/auto_inflate.rb'
|
|
121
|
-
- 'lib/http/headers.rb'
|
|
122
|
-
- 'lib/http/options.rb'
|
|
123
|
-
- 'lib/http/redirector.rb'
|
|
124
|
-
- 'lib/http/request.rb'
|
|
125
|
-
- 'lib/http/response.rb'
|
|
126
|
-
- 'lib/http/response/body.rb'
|
|
127
|
-
- 'lib/http/retriable/performer.rb'
|
|
128
|
-
- 'lib/http/timeout/global.rb'
|
|
129
|
-
|
|
130
|
-
# Offense count: 1
|
|
131
|
-
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
132
|
-
Metrics/ModuleLength:
|
|
133
|
-
Exclude:
|
|
134
|
-
- 'lib/http/chainable.rb'
|
|
135
|
-
|
|
136
|
-
# Offense count: 1
|
|
137
|
-
Security/CompoundHash:
|
|
138
|
-
Exclude:
|
|
139
|
-
- 'lib/http/uri.rb'
|
|
140
|
-
|
|
141
|
-
# Offense count: 2
|
|
142
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
143
|
-
# Configuration parameters: EnforcedStyle.
|
|
144
|
-
# SupportedStyles: separated, grouped
|
|
145
|
-
Style/AccessorGrouping:
|
|
146
|
-
Exclude:
|
|
147
|
-
- 'lib/http/request.rb'
|
|
148
|
-
|
|
149
|
-
# Offense count: 4
|
|
150
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
151
|
-
Style/EmptyCaseCondition:
|
|
152
|
-
Exclude:
|
|
153
|
-
- 'lib/http/client.rb'
|
|
154
|
-
- 'lib/http/headers.rb'
|
|
155
|
-
- 'lib/http/options.rb'
|
|
156
|
-
- 'lib/http/response/status.rb'
|
|
157
|
-
|
|
158
|
-
# Offense count: 5
|
|
159
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
160
|
-
Style/Encoding:
|
|
161
|
-
Exclude:
|
|
162
|
-
- 'spec/lib/http/client_spec.rb'
|
|
163
|
-
- 'spec/lib/http/request/writer_spec.rb'
|
|
164
|
-
- 'spec/lib/http/request_spec.rb'
|
|
165
|
-
- 'spec/lib/http_spec.rb'
|
|
166
|
-
- 'spec/support/dummy_server/servlet.rb'
|
|
167
|
-
|
|
168
|
-
# Offense count: 71
|
|
169
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
170
|
-
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
171
|
-
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
|
172
|
-
# SupportedShorthandSyntax: always, never, either
|
|
173
|
-
Style/HashSyntax:
|
|
174
|
-
Exclude:
|
|
175
|
-
- 'spec/lib/http/features/raise_error_spec.rb'
|
|
176
|
-
- 'spec/lib/http/retriable/delay_calculator_spec.rb'
|
|
177
|
-
- 'spec/lib/http/retriable/performer_spec.rb'
|
|
178
|
-
- 'spec/lib/http_spec.rb'
|
|
179
|
-
|
|
180
|
-
# Offense count: 4
|
|
181
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
182
|
-
# Configuration parameters: EnforcedStyle.
|
|
183
|
-
# SupportedStyles: literals, strict
|
|
184
|
-
Style/MutableConstant:
|
|
185
|
-
Exclude:
|
|
186
|
-
- 'lib/http/headers/normalizer.rb'
|
|
187
|
-
- 'lib/http/retriable/delay_calculator.rb'
|
|
188
|
-
|
|
189
|
-
# Offense count: 17
|
|
190
|
-
# Configuration parameters: SuspiciousParamNames, Allowlist.
|
|
191
|
-
# SuspiciousParamNames: options, opts, args, params, parameters
|
|
192
|
-
Style/OptionHash:
|
|
193
|
-
Exclude:
|
|
194
|
-
- 'lib/http/chainable.rb'
|
|
195
|
-
- 'lib/http/client.rb'
|
|
196
|
-
- 'lib/http/feature.rb'
|
|
197
|
-
- 'lib/http/options.rb'
|
|
198
|
-
- 'lib/http/redirector.rb'
|
|
199
|
-
- 'lib/http/timeout/null.rb'
|
|
200
|
-
- 'spec/support/dummy_server.rb'
|
|
201
|
-
|
|
202
|
-
# Offense count: 4
|
|
203
|
-
# Configuration parameters: AllowedMethods.
|
|
204
|
-
# AllowedMethods: respond_to_missing?
|
|
205
|
-
Style/OptionalBooleanParameter:
|
|
206
|
-
Exclude:
|
|
207
|
-
- 'lib/http/timeout/global.rb'
|
|
208
|
-
- 'lib/http/timeout/null.rb'
|
|
209
|
-
- 'lib/http/timeout/per_operation.rb'
|
|
210
|
-
- 'lib/http/uri.rb'
|
|
211
|
-
|
|
212
|
-
# Offense count: 3
|
|
213
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
214
|
-
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
|
215
|
-
# URISchemes: http, https
|
|
216
|
-
Layout/LineLength:
|
|
217
|
-
Exclude:
|
|
218
|
-
- 'lib/http/chainable.rb'
|
|
219
|
-
- 'spec/lib/http/options/proxy_spec.rb'
|
data/.yardopts
DELETED