httpi 2.5.0 → 4.0.4
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 +41 -0
- data/README.md +25 -10
- data/UPDATING.md +11 -0
- data/lib/httpi/adapter/net_http.rb +0 -2
- data/lib/httpi/adapter.rb +2 -0
- data/lib/httpi/request.rb +2 -2
- data/lib/httpi/response.rb +1 -1
- data/lib/httpi/utils.rb +95 -0
- data/lib/httpi/version.rb +1 -1
- data/lib/httpi.rb +7 -1
- metadata +56 -61
- data/.github/workflows/development.yml +0 -48
- data/.gitignore +0 -11
- data/.rspec +0 -1
- data/Gemfile +0 -22
- data/Rakefile +0 -18
- data/httpi.gemspec +0 -31
- data/spec/fixtures/attachment.gif +0 -0
- data/spec/fixtures/client_cert.pem +0 -20
- data/spec/fixtures/client_key.pem +0 -27
- data/spec/fixtures/xml.gz +0 -0
- data/spec/fixtures/xml.xml +0 -10
- data/spec/fixtures/xml_dime.dime +0 -0
- data/spec/fixtures/xml_dime.xml +0 -1
- data/spec/httpi/adapter/base_spec.rb +0 -23
- data/spec/httpi/adapter/curb_spec.rb +0 -351
- data/spec/httpi/adapter/em_http_spec.rb +0 -180
- data/spec/httpi/adapter/excon_spec.rb +0 -34
- data/spec/httpi/adapter/http_spec.rb +0 -28
- data/spec/httpi/adapter/httpclient_spec.rb +0 -238
- data/spec/httpi/adapter/net_http_persistent_spec.rb +0 -46
- data/spec/httpi/adapter/net_http_spec.rb +0 -54
- data/spec/httpi/adapter/rack_spec.rb +0 -109
- data/spec/httpi/adapter_spec.rb +0 -68
- data/spec/httpi/auth/config_spec.rb +0 -163
- data/spec/httpi/auth/ssl_spec.rb +0 -216
- data/spec/httpi/cookie_spec.rb +0 -36
- data/spec/httpi/cookie_store_spec.rb +0 -26
- data/spec/httpi/error_spec.rb +0 -43
- data/spec/httpi/httpi_spec.rb +0 -358
- data/spec/httpi/request_spec.rb +0 -290
- data/spec/httpi/response_spec.rb +0 -142
- data/spec/integration/curb_spec.rb +0 -139
- data/spec/integration/em_http_spec.rb +0 -108
- data/spec/integration/excon_spec.rb +0 -174
- data/spec/integration/fixtures/ca_all.pem +0 -19
- data/spec/integration/fixtures/server.cert +0 -19
- data/spec/integration/fixtures/server.key +0 -27
- data/spec/integration/http_spec.rb +0 -156
- data/spec/integration/httpclient_spec.rb +0 -136
- data/spec/integration/net_http_persistent_spec.rb +0 -171
- data/spec/integration/net_http_spec.rb +0 -274
- data/spec/integration/support/application.rb +0 -97
- data/spec/integration/support/server.rb +0 -83
- data/spec/spec_helper.rb +0 -23
- data/spec/support/error_helper.rb +0 -26
- data/spec/support/fixture.rb +0 -27
- data/spec/support/matchers.rb +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe1562efbf5ab9aceadc7635826a4cf7317b83d5847c413bdce3462e23728f50
|
|
4
|
+
data.tar.gz: 2149ada8b2ec173323c1dd248a57d7666bdb9b6a1e0ae83c25e7f96f4c91539b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz: '
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0964bc62dd38fcd02d9c2c5ae9b07031b7719ccdb3ff831dc6d9f563a1fd0bd085d55e741cd30e063d64b6e3c548d347f8ec9ede647790ed54c4c68d8d50d222'
|
|
7
|
+
data.tar.gz: 61d4a274d5a330c886ccce1f773ee41567f9d09b216f1eca513ab7646f484e708295548732670a0025726713294c09aa704630c840971a57f79d34db653b97c5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
### Unreleased
|
|
2
|
+
|
|
3
|
+
* Add your changelog entry here
|
|
4
|
+
|
|
5
|
+
### 4.0.4 (2024-07-14)
|
|
6
|
+
|
|
7
|
+
* gemspec: Exclude spec files from published gem by @ChristopherBert in https://github.com/savonrb/httpi/pull/252
|
|
8
|
+
|
|
9
|
+
### 4.0.3 (2024-07-06)
|
|
10
|
+
|
|
11
|
+
* Allow use with rack 3.1
|
|
12
|
+
|
|
13
|
+
### 4.0.2 (2024-06-13)
|
|
14
|
+
|
|
15
|
+
* Don't change http header casing by @pcai in https://github.com/savonrb/httpi/pull/249
|
|
16
|
+
|
|
17
|
+
### 4.0.1 (2024-02-16)
|
|
18
|
+
|
|
19
|
+
HTTPI is officially in maintenance mode. Our emphasis will now be on bugs, security fixes, and compatibility with the wider ecosystem. See [this issue](https://github.com/savonrb/httpi/issues/238) for details.
|
|
20
|
+
|
|
21
|
+
* Adds support for rack 3.0.
|
|
22
|
+
* POTENTIAL BREAKING CHANGE: `HTTPI::Request#headers` and `HTTPI::Response#headers` now return `HTTPI::Utils::Headers` instead of `Rack::Utils::HeaderHash`. This change will prevent HTTPI from breaking or changing its public API whenever rack rearranges its classes. If you were relying on the `Rack::Utils::HeaderHash` implementation, you will need to update your code to use `HTTPI::Utils::Headers` instead.
|
|
23
|
+
|
|
24
|
+
### 4.0.0 (yanked)
|
|
25
|
+
|
|
26
|
+
Yanked due to a bug when used with rack 2.
|
|
27
|
+
|
|
28
|
+
### 3.0.2 (2024-02-10)
|
|
29
|
+
|
|
30
|
+
* Improvement: [#237](https://github.com/savonrb/httpi/pull/237) Implemented `adapter_client_setup`.
|
|
31
|
+
* Add support for ruby 3.1, 3.2, 3.3. Drop support for ruby 2.7 and below.
|
|
32
|
+
* Pin to rack version < 3, HTTPI is not tested with rack 3 yet.
|
|
33
|
+
|
|
34
|
+
### 3.0.1 (2021-12-17)
|
|
35
|
+
|
|
36
|
+
* Fix: [#230](https://github.com/savonrb/httpi/pull/230) Make rack a runtime dependency.
|
|
37
|
+
|
|
38
|
+
### 3.0.0 (2021-10-19)
|
|
39
|
+
|
|
40
|
+
* Improvement: [#225](https://github.com/savonrb/httpi/pull/225) Make rack and socksify dependencies optional.
|
|
41
|
+
|
|
1
42
|
### 2.5.0 (2021-10-05)
|
|
2
43
|
|
|
3
44
|
* Feature: [#214](https://github.com/savonrb/httpi/pull/214) Add SSL ciphers configuration
|
data/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# HTTPI
|
|
2
2
|
|
|
3
|
-
A common interface for Ruby's HTTP libraries.
|
|
3
|
+
A common interface for Ruby's HTTP libraries. This project is now in maintenance mode. For new projects, we recommend [faraday](https://github.com/lostisland/faraday).
|
|
4
4
|
|
|
5
|
-
[Documentation](https://www.rubydoc.info/gems/httpi)
|
|
6
|
-
[Mailing list](https://groups.google.com/forum/#!forum/httpirb)
|
|
5
|
+
[Documentation](https://www.rubydoc.info/gems/httpi)
|
|
7
6
|
|
|
8
7
|
[](https://github.com/savonrb/httpi/actions/workflows/development.yml)
|
|
9
8
|
|
|
@@ -11,16 +10,11 @@ A common interface for Ruby's HTTP libraries.
|
|
|
11
10
|
|
|
12
11
|
HTTPI is available through [Rubygems](https://rubygems.org/gems/httpi) and can be installed via:
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
$ gem install httpi
|
|
16
|
-
```
|
|
13
|
+
$ gem install httpi
|
|
17
14
|
|
|
18
15
|
or add it to your Gemfile like this:
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
gem 'httpi', '~> 2.1.0'
|
|
22
|
-
```
|
|
23
|
-
|
|
17
|
+
gem 'httpi', '~> 4.0.0'
|
|
24
18
|
|
|
25
19
|
## Usage example
|
|
26
20
|
|
|
@@ -42,8 +36,29 @@ HTTPI.adapter = :httpclient
|
|
|
42
36
|
|
|
43
37
|
# and execute arbitary requests
|
|
44
38
|
HTTPI.request(:custom, request)
|
|
39
|
+
|
|
40
|
+
# add a client setup block that will be called before each request
|
|
41
|
+
HTTPI.adapter = :httpclient
|
|
42
|
+
HTTPI.adapter_client_setup = proc do |x|
|
|
43
|
+
x.ssl_config.set_default_paths
|
|
44
|
+
x.force_basic_auth = true
|
|
45
|
+
end
|
|
46
|
+
# ...
|
|
47
|
+
HTTPI.get(request) do |x|
|
|
48
|
+
x.force_basic_auth = false
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### SOCKS Proxy Support
|
|
53
|
+
|
|
54
|
+
To use the the SOCKS proxy support, please add the `socksify` gem to your gemfile, and add the following code:
|
|
55
|
+
|
|
56
|
+
``` ruby
|
|
57
|
+
require 'socksify'
|
|
58
|
+
require 'socksify/http'
|
|
45
59
|
```
|
|
46
60
|
|
|
61
|
+
to your project.
|
|
47
62
|
|
|
48
63
|
## Documentation
|
|
49
64
|
|
data/UPDATING.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Update guide
|
|
2
|
+
|
|
3
|
+
## From 2.x to 3.x
|
|
4
|
+
|
|
5
|
+
BREAKING CHANGE: the [#255](https://github.com/savonrb/httpi/pull/225) made the gem socksify and rack gems optional dependencies.
|
|
6
|
+
|
|
7
|
+
In order to restore the old behavior, see the README section "SOCKS Proxy Support" and "Rack Mock Adapter".
|
|
8
|
+
|
|
9
|
+
## From 3.x to 4.x
|
|
10
|
+
|
|
11
|
+
POTENTIAL BREAKING CHANGE: `HTTPI::Request#headers` and `HTTPI::Response#headers` now return `HTTPI::Utils::Headers` instead of `Rack::Utils::HeaderHash`. This change will prevent HTTPI from breaking or changing its public API whenever rack rearranges its classes. If you were relying on the `Rack::Utils::HeaderHash` implementation, you will need to update your code to use `HTTPI::Utils::Headers` instead.
|
data/lib/httpi/adapter.rb
CHANGED
data/lib/httpi/request.rb
CHANGED
|
@@ -64,12 +64,12 @@ module HTTPI
|
|
|
64
64
|
|
|
65
65
|
# Returns a Hash of HTTP headers. Defaults to return an empty Hash.
|
|
66
66
|
def headers
|
|
67
|
-
@headers ||=
|
|
67
|
+
@headers ||= HTTPI::Utils::Headers.new
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
# Sets the Hash of HTTP headers.
|
|
71
71
|
def headers=(headers)
|
|
72
|
-
@headers =
|
|
72
|
+
@headers = HTTPI::Utils::Headers.new.merge(headers)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
# Adds a header information to accept gzipped content.
|
data/lib/httpi/response.rb
CHANGED
|
@@ -20,7 +20,7 @@ module HTTPI
|
|
|
20
20
|
# Initializer expects an HTTP response +code+, +headers+ and +body+.
|
|
21
21
|
def initialize(code, headers, body)
|
|
22
22
|
self.code = code.to_i
|
|
23
|
-
self.headers =
|
|
23
|
+
self.headers = HTTPI::Utils::Headers.new.merge(headers)
|
|
24
24
|
self.raw_body = body
|
|
25
25
|
end
|
|
26
26
|
|
data/lib/httpi/utils.rb
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# mostly verbatim from: https://github.com/rack/rack/blob/main/lib/rack/headers.rb
|
|
2
|
+
# Because this is part of httpi's public API, its better not to load an external
|
|
3
|
+
# library for it.
|
|
4
|
+
module HTTPI
|
|
5
|
+
module Utils
|
|
6
|
+
# A case-insensitive Hash that preserves the original case of a
|
|
7
|
+
# header when set.
|
|
8
|
+
#
|
|
9
|
+
class Headers < Hash
|
|
10
|
+
def self.[](headers)
|
|
11
|
+
if headers.is_a?(Headers) && !headers.frozen?
|
|
12
|
+
return headers
|
|
13
|
+
else
|
|
14
|
+
return self.new(headers)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def initialize(hash = {})
|
|
19
|
+
super()
|
|
20
|
+
@names = {}
|
|
21
|
+
hash.each { |k, v| self[k] = v }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# on dup/clone, we need to duplicate @names hash
|
|
25
|
+
def initialize_copy(other)
|
|
26
|
+
super
|
|
27
|
+
@names = other.names.dup
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# on clear, we need to clear @names hash
|
|
31
|
+
def clear
|
|
32
|
+
super
|
|
33
|
+
@names.clear
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def each
|
|
37
|
+
super do |k, v|
|
|
38
|
+
yield(k, v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def to_hash
|
|
43
|
+
hash = {}
|
|
44
|
+
each { |k, v| hash[k] = v }
|
|
45
|
+
hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def [](k)
|
|
49
|
+
super(k) || super(@names[k.downcase])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def []=(k, v)
|
|
53
|
+
canonical = k.downcase.freeze
|
|
54
|
+
delete k if @names[canonical] && @names[canonical] != k # .delete is expensive, don't invoke it unless necessary
|
|
55
|
+
@names[canonical] = k
|
|
56
|
+
super k, v
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def delete(k)
|
|
60
|
+
canonical = k.downcase
|
|
61
|
+
result = super @names.delete(canonical)
|
|
62
|
+
result
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def include?(k)
|
|
66
|
+
super || @names.include?(k.downcase)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
alias_method :has_key?, :include?
|
|
70
|
+
alias_method :member?, :include?
|
|
71
|
+
alias_method :key?, :include?
|
|
72
|
+
|
|
73
|
+
def merge!(other)
|
|
74
|
+
other.each { |k, v| self[k] = v }
|
|
75
|
+
self
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def merge(other)
|
|
79
|
+
hash = dup
|
|
80
|
+
hash.merge! other
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def replace(other)
|
|
84
|
+
clear
|
|
85
|
+
other.each { |k, v| self[k] = v }
|
|
86
|
+
self
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
protected
|
|
90
|
+
def names
|
|
91
|
+
@names
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
data/lib/httpi/version.rb
CHANGED
data/lib/httpi.rb
CHANGED
|
@@ -3,6 +3,7 @@ require "httpi/version"
|
|
|
3
3
|
require "httpi/logger"
|
|
4
4
|
require "httpi/request"
|
|
5
5
|
require "httpi/query_builder"
|
|
6
|
+
require "httpi/utils"
|
|
6
7
|
|
|
7
8
|
require "httpi/adapter/httpclient"
|
|
8
9
|
require "httpi/adapter/curb"
|
|
@@ -154,7 +155,8 @@ module HTTPI
|
|
|
154
155
|
# Executes an HTTP request for the given +method+.
|
|
155
156
|
def request(method, request, adapter = nil, redirects = 0)
|
|
156
157
|
adapter_class = load_adapter(adapter, request)
|
|
157
|
-
|
|
158
|
+
|
|
159
|
+
Adapter.client_setup_block.call(adapter_class.client) if Adapter.client_setup_block
|
|
158
160
|
yield adapter_class.client if block_given?
|
|
159
161
|
log_request(method, request, Adapter.identify(adapter_class.class))
|
|
160
162
|
|
|
@@ -174,6 +176,10 @@ module HTTPI
|
|
|
174
176
|
Adapter.use = adapter
|
|
175
177
|
end
|
|
176
178
|
|
|
179
|
+
def adapter_client_setup=(block)
|
|
180
|
+
Adapter.client_setup_block = block
|
|
181
|
+
end
|
|
182
|
+
|
|
177
183
|
private
|
|
178
184
|
|
|
179
185
|
def request_and_adapter_from(args)
|
metadata
CHANGED
|
@@ -1,18 +1,52 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: httpi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Harrington
|
|
8
8
|
- Martin Tepper
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2024-07-14 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rack
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
requirements:
|
|
18
|
+
- - ">="
|
|
19
|
+
- !ruby/object:Gem::Version
|
|
20
|
+
version: '2.0'
|
|
21
|
+
- - "<"
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: '4'
|
|
24
|
+
type: :runtime
|
|
25
|
+
prerelease: false
|
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
27
|
+
requirements:
|
|
28
|
+
- - ">="
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
version: '2.0'
|
|
31
|
+
- - "<"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '4'
|
|
34
|
+
- !ruby/object:Gem::Dependency
|
|
35
|
+
name: nkf
|
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
type: :runtime
|
|
42
|
+
prerelease: false
|
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
name: base64
|
|
16
50
|
requirement: !ruby/object:Gem::Requirement
|
|
17
51
|
requirements:
|
|
18
52
|
- - ">="
|
|
@@ -26,7 +60,7 @@ dependencies:
|
|
|
26
60
|
- !ruby/object:Gem::Version
|
|
27
61
|
version: '0'
|
|
28
62
|
- !ruby/object:Gem::Dependency
|
|
29
|
-
name:
|
|
63
|
+
name: mutex_m
|
|
30
64
|
requirement: !ruby/object:Gem::Requirement
|
|
31
65
|
requirements:
|
|
32
66
|
- - ">="
|
|
@@ -45,14 +79,14 @@ dependencies:
|
|
|
45
79
|
requirements:
|
|
46
80
|
- - "~>"
|
|
47
81
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: 0.
|
|
82
|
+
version: 0.6.4
|
|
49
83
|
type: :development
|
|
50
84
|
prerelease: false
|
|
51
85
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
86
|
requirements:
|
|
53
87
|
- - "~>"
|
|
54
88
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 0.
|
|
89
|
+
version: 0.6.4
|
|
56
90
|
- !ruby/object:Gem::Dependency
|
|
57
91
|
name: rake
|
|
58
92
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -101,14 +135,14 @@ dependencies:
|
|
|
101
135
|
requirements:
|
|
102
136
|
- - "~>"
|
|
103
137
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '
|
|
138
|
+
version: '6.0'
|
|
105
139
|
type: :development
|
|
106
140
|
prerelease: false
|
|
107
141
|
version_requirements: !ruby/object:Gem::Requirement
|
|
108
142
|
requirements:
|
|
109
143
|
- - "~>"
|
|
110
144
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: '
|
|
145
|
+
version: '6.0'
|
|
112
146
|
- !ruby/object:Gem::Dependency
|
|
113
147
|
name: webmock
|
|
114
148
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -129,15 +163,10 @@ executables: []
|
|
|
129
163
|
extensions: []
|
|
130
164
|
extra_rdoc_files: []
|
|
131
165
|
files:
|
|
132
|
-
- ".github/workflows/development.yml"
|
|
133
|
-
- ".gitignore"
|
|
134
|
-
- ".rspec"
|
|
135
166
|
- CHANGELOG.md
|
|
136
|
-
- Gemfile
|
|
137
167
|
- LICENSE
|
|
138
168
|
- README.md
|
|
139
|
-
-
|
|
140
|
-
- httpi.gemspec
|
|
169
|
+
- UPDATING.md
|
|
141
170
|
- lib/httpi.rb
|
|
142
171
|
- lib/httpi/adapter.rb
|
|
143
172
|
- lib/httpi/adapter/base.rb
|
|
@@ -158,53 +187,19 @@ files:
|
|
|
158
187
|
- lib/httpi/query_builder.rb
|
|
159
188
|
- lib/httpi/request.rb
|
|
160
189
|
- lib/httpi/response.rb
|
|
190
|
+
- lib/httpi/utils.rb
|
|
161
191
|
- lib/httpi/version.rb
|
|
162
|
-
|
|
163
|
-
- spec/fixtures/client_cert.pem
|
|
164
|
-
- spec/fixtures/client_key.pem
|
|
165
|
-
- spec/fixtures/xml.gz
|
|
166
|
-
- spec/fixtures/xml.xml
|
|
167
|
-
- spec/fixtures/xml_dime.dime
|
|
168
|
-
- spec/fixtures/xml_dime.xml
|
|
169
|
-
- spec/httpi/adapter/base_spec.rb
|
|
170
|
-
- spec/httpi/adapter/curb_spec.rb
|
|
171
|
-
- spec/httpi/adapter/em_http_spec.rb
|
|
172
|
-
- spec/httpi/adapter/excon_spec.rb
|
|
173
|
-
- spec/httpi/adapter/http_spec.rb
|
|
174
|
-
- spec/httpi/adapter/httpclient_spec.rb
|
|
175
|
-
- spec/httpi/adapter/net_http_persistent_spec.rb
|
|
176
|
-
- spec/httpi/adapter/net_http_spec.rb
|
|
177
|
-
- spec/httpi/adapter/rack_spec.rb
|
|
178
|
-
- spec/httpi/adapter_spec.rb
|
|
179
|
-
- spec/httpi/auth/config_spec.rb
|
|
180
|
-
- spec/httpi/auth/ssl_spec.rb
|
|
181
|
-
- spec/httpi/cookie_spec.rb
|
|
182
|
-
- spec/httpi/cookie_store_spec.rb
|
|
183
|
-
- spec/httpi/error_spec.rb
|
|
184
|
-
- spec/httpi/httpi_spec.rb
|
|
185
|
-
- spec/httpi/request_spec.rb
|
|
186
|
-
- spec/httpi/response_spec.rb
|
|
187
|
-
- spec/integration/curb_spec.rb
|
|
188
|
-
- spec/integration/em_http_spec.rb
|
|
189
|
-
- spec/integration/excon_spec.rb
|
|
190
|
-
- spec/integration/fixtures/ca_all.pem
|
|
191
|
-
- spec/integration/fixtures/server.cert
|
|
192
|
-
- spec/integration/fixtures/server.key
|
|
193
|
-
- spec/integration/http_spec.rb
|
|
194
|
-
- spec/integration/httpclient_spec.rb
|
|
195
|
-
- spec/integration/net_http_persistent_spec.rb
|
|
196
|
-
- spec/integration/net_http_spec.rb
|
|
197
|
-
- spec/integration/support/application.rb
|
|
198
|
-
- spec/integration/support/server.rb
|
|
199
|
-
- spec/spec_helper.rb
|
|
200
|
-
- spec/support/error_helper.rb
|
|
201
|
-
- spec/support/fixture.rb
|
|
202
|
-
- spec/support/matchers.rb
|
|
203
|
-
homepage: http://github.com/savonrb/httpi
|
|
192
|
+
homepage: https://github.com/savonrb/httpi
|
|
204
193
|
licenses:
|
|
205
194
|
- MIT
|
|
206
|
-
metadata:
|
|
207
|
-
|
|
195
|
+
metadata:
|
|
196
|
+
bug_tracker_uri: https://github.com/savonrb/httpi/issues
|
|
197
|
+
changelog_uri: https://github.com/savonrb/httpi/blob/master/CHANGELOG.md
|
|
198
|
+
source_code_uri: https://github.com/savonrb/httpi
|
|
199
|
+
wiki_uri: https://github.com/savonrb/httpi/wiki
|
|
200
|
+
documentation_uri: https://www.rubydoc.info/gems/httpi
|
|
201
|
+
rubygems_mfa_required: 'true'
|
|
202
|
+
post_install_message:
|
|
208
203
|
rdoc_options: []
|
|
209
204
|
require_paths:
|
|
210
205
|
- lib
|
|
@@ -212,15 +207,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
212
207
|
requirements:
|
|
213
208
|
- - ">="
|
|
214
209
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: '
|
|
210
|
+
version: '3.0'
|
|
216
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
212
|
requirements:
|
|
218
213
|
- - ">="
|
|
219
214
|
- !ruby/object:Gem::Version
|
|
220
215
|
version: '0'
|
|
221
216
|
requirements: []
|
|
222
|
-
rubygems_version: 3.
|
|
223
|
-
signing_key:
|
|
217
|
+
rubygems_version: 3.5.3
|
|
218
|
+
signing_key:
|
|
224
219
|
specification_version: 4
|
|
225
220
|
summary: Common interface for Ruby's HTTP libraries
|
|
226
221
|
test_files: []
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
name: Development
|
|
2
|
-
|
|
3
|
-
on: [push, pull_request]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
test:
|
|
7
|
-
name: ${{matrix.ruby}} on ${{matrix.os}}
|
|
8
|
-
runs-on: ${{matrix.os}}-latest
|
|
9
|
-
continue-on-error: ${{matrix.experimental}}
|
|
10
|
-
|
|
11
|
-
strategy:
|
|
12
|
-
matrix:
|
|
13
|
-
os:
|
|
14
|
-
- ubuntu
|
|
15
|
-
|
|
16
|
-
ruby:
|
|
17
|
-
- "2.6"
|
|
18
|
-
- "2.7"
|
|
19
|
-
- "3.0"
|
|
20
|
-
|
|
21
|
-
experimental: [false]
|
|
22
|
-
env: [""]
|
|
23
|
-
|
|
24
|
-
include:
|
|
25
|
-
- os: ubuntu
|
|
26
|
-
ruby: truffleruby
|
|
27
|
-
experimental: true
|
|
28
|
-
- os: ubuntu
|
|
29
|
-
ruby: jruby
|
|
30
|
-
experimental: true
|
|
31
|
-
- os: ubuntu
|
|
32
|
-
ruby: head
|
|
33
|
-
experimental: true
|
|
34
|
-
|
|
35
|
-
steps:
|
|
36
|
-
- uses: actions/checkout@v2
|
|
37
|
-
|
|
38
|
-
- name: Install dependencies
|
|
39
|
-
run: sudo apt-get install libcurl4-openssl-dev
|
|
40
|
-
|
|
41
|
-
- uses: ruby/setup-ruby@v1
|
|
42
|
-
with:
|
|
43
|
-
ruby-version: ${{matrix.ruby}}
|
|
44
|
-
bundler-cache: true
|
|
45
|
-
|
|
46
|
-
- name: Run tests
|
|
47
|
-
timeout-minutes: 5
|
|
48
|
-
run: ${{matrix.env}} bundle exec rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|
data/Gemfile
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'jruby-openssl', :platforms => :jruby
|
|
5
|
-
|
|
6
|
-
gem 'public_suffix', '~> 4.0'
|
|
7
|
-
|
|
8
|
-
# http clients
|
|
9
|
-
gem 'httpclient', '~> 2.3', :require => false
|
|
10
|
-
gem 'curb', '~> 0.8', :require => false, :platforms => [:ruby]
|
|
11
|
-
gem 'em-http-request', :require => false, :platforms => [:ruby]
|
|
12
|
-
gem 'em-synchrony', :require => false, :platforms => [:ruby, :jruby]
|
|
13
|
-
gem 'excon', '~> 0.21', :require => false, :platforms => [:ruby, :jruby]
|
|
14
|
-
gem 'net-http-persistent', '~> 4.0', :require => false
|
|
15
|
-
gem 'http', :require => false
|
|
16
|
-
|
|
17
|
-
# adapter extensions
|
|
18
|
-
gem 'rack'
|
|
19
|
-
gem 'socksify'
|
|
20
|
-
|
|
21
|
-
# coverage
|
|
22
|
-
gem 'simplecov', :require => false
|
data/Rakefile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
require "rspec/core/rake_task"
|
|
3
|
-
|
|
4
|
-
RSpec::Core::RakeTask.new do |t|
|
|
5
|
-
t.pattern = "spec/httpi/**/*_spec.rb"
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
desc "Run RSpec integration examples"
|
|
9
|
-
RSpec::Core::RakeTask.new "spec_integration" do |t|
|
|
10
|
-
t.pattern = "spec/integration/*_spec.rb"
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
desc "Run RSpec code and integration examples"
|
|
14
|
-
RSpec::Core::RakeTask.new "ci" do |t|
|
|
15
|
-
t.pattern = "spec/{httpi,integration}/**/*_spec.rb"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
task :default => :spec
|
data/httpi.gemspec
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
lib = File.expand_path('../lib/', __FILE__)
|
|
2
|
-
$:.unshift lib unless $:.include?(lib)
|
|
3
|
-
|
|
4
|
-
require 'httpi/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |s|
|
|
7
|
-
s.name = 'httpi'
|
|
8
|
-
s.version = HTTPI::VERSION
|
|
9
|
-
s.authors = ['Daniel Harrington', 'Martin Tepper']
|
|
10
|
-
s.email = 'me@rubiii.com'
|
|
11
|
-
s.homepage = "http://github.com/savonrb/#{s.name}"
|
|
12
|
-
s.summary = "Common interface for Ruby's HTTP libraries"
|
|
13
|
-
s.description = s.summary
|
|
14
|
-
|
|
15
|
-
s.required_ruby_version = '>= 2.3'
|
|
16
|
-
|
|
17
|
-
s.license = 'MIT'
|
|
18
|
-
|
|
19
|
-
s.add_dependency 'rack'
|
|
20
|
-
s.add_dependency 'socksify'
|
|
21
|
-
|
|
22
|
-
s.add_development_dependency 'rubyntlm', '~> 0.3.2'
|
|
23
|
-
s.add_development_dependency 'rake', '~> 13.0'
|
|
24
|
-
s.add_development_dependency 'rspec', '~> 3.5'
|
|
25
|
-
s.add_development_dependency 'mocha', '~> 0.13'
|
|
26
|
-
s.add_development_dependency 'puma', '~> 5.0'
|
|
27
|
-
s.add_development_dependency 'webmock'
|
|
28
|
-
|
|
29
|
-
s.files = `git ls-files`.split("\n")
|
|
30
|
-
s.require_path = 'lib'
|
|
31
|
-
end
|
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
|
2
|
-
MIIDVTCCAj2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQKDBhEZXZl
|
|
3
|
-
bG9wbWVudC9DTj1sb2NhbGhvc3QwHhcNMTgwODEwMDAzMTQzWhcNMjgwODA3MDAz
|
|
4
|
-
MTQzWjAjMSEwHwYDVQQKDBhEZXZlbG9wbWVudC9DTj1sb2NhbGhvc3QwggEiMA0G
|
|
5
|
-
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbU3vifU9omTx5T6ECuYnvryr4iWPP
|
|
6
|
-
A4sXhduO8aD3IdA8zHlPtZnmh0liE30nAY00xKa4Eisxs9/UgUoHlEb5nCtYs6Od
|
|
7
|
-
9pjiuyry2G5lBHIhLlVNTbReRKfjhr3ewUxcnQN0xiynjfsUMbzoVI1ZsGDWZ9gF
|
|
8
|
-
4DHg3Accee3+/BNBDTWixYXh64D9YI1Tj/3fC1I2taUp32jdLXE9mbCByQlk5EZf
|
|
9
|
-
BZUWx868FtwwzU3ymbq2uQQtTl5a0QHqLUwb0nkdewoRvaZJFkopI+1tgy0Hs+pY
|
|
10
|
-
QM99vQWS7ViM5qbVYtPil/4VVWJbx/kQi/To4/Q8TxYbIRkoeJSOq9U3AgMBAAGj
|
|
11
|
-
gZMwgZAwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU4W1eb4Zc4NOpBe8UXcmIzLHB
|
|
12
|
-
FFQwSwYDVR0jBEQwQoAU4W1eb4Zc4NOpBe8UXcmIzLHBFFShJ6QlMCMxITAfBgNV
|
|
13
|
-
BAoMGERldmVsb3BtZW50L0NOPWxvY2FsaG9zdIIBATAUBgNVHREEDTALgglsb2Nh
|
|
14
|
-
bGhvc3QwDQYJKoZIhvcNAQELBQADggEBAM7oYR6eVIascNLhgfJFboVernRl137Y
|
|
15
|
-
7hyjBQTSleMame/VN1MwMscUYpen8rFu9lUviKe9fxV/7OqNR4vvZ83ttbb+CxJ7
|
|
16
|
-
3mwoQHufjrGcxsWUKrmtJsXAGZpGJFw7ygnKDAfDPKWSKYeUuQ417AutPWSvhWqa
|
|
17
|
-
LEohhNCeHJj/+3U2vj2g2rvy0AASeMff9IMz/lpPZ2bjJQjlITXXPvswB2/uZSRT
|
|
18
|
-
KWEifqfo03/nTjhzN7dz2hXEeZHroCq6FZa1R6smYVM79TORFWiKfdKtjXI8wQQ2
|
|
19
|
-
BhVJpWQB2yw9d/4Q7x2EPjJEPiVoRLW0vF8uxr++14nhVkSpYJCSNAw=
|
|
20
|
-
-----END CERTIFICATE-----
|