http 3.2.1 → 3.3.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/CHANGES.md +12 -1
- data/lib/http/chainable.rb +9 -0
- data/lib/http/client.rb +13 -8
- data/lib/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 853087de359024f397422b0563f0232edfa247c2f201a060c10b7b8ea9aff00b
|
4
|
+
data.tar.gz: b07ad1d88da70f9d76c5e272923dab3ce763077a8f8f7cb9ee6c37602acb6bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654f47604b4e77c1138f9b82b5b902bf5d47f3bdc73979594633fc1d15c991eab5d933f001f1e6671bd432c498127f9b3ddb89cc2dc93fd3b792461961f1f1a0
|
7
|
+
data.tar.gz: 4f8e97ea9830b1f36d5a0d636807e3f1296176640c2876d0f66c59d0643954e663d5c35ab14a538220b5f669195109a367b70d6ad281898ecb3830ce573cd485
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 3.3.0 (2018-04-25)
|
2
|
+
|
3
|
+
This version backports some of the fixes and improvements made to development
|
4
|
+
version of the HTTP gem:
|
5
|
+
|
6
|
+
* [#458](https://github.com/httprb/http/pull/458)
|
7
|
+
Extract HTTP::Client#build_request method.
|
8
|
+
([@tycoon])
|
9
|
+
|
10
|
+
|
1
11
|
## 3.2.1 (2018-04-24)
|
2
12
|
|
3
13
|
* [#468](https://github.com/httprb/http/pull/468)
|
@@ -7,7 +17,7 @@
|
|
7
17
|
|
8
18
|
## 3.2.0 (2018-04-22)
|
9
19
|
|
10
|
-
This
|
20
|
+
This version backports one change we missed to backport in previous release:
|
11
21
|
|
12
22
|
* Reduce memory usage when reading response body
|
13
23
|
([@janko-m])
|
@@ -657,3 +667,4 @@ end
|
|
657
667
|
[@marshall-lee]: https://github.com/marshall-lee
|
658
668
|
[@scarfacedeb]: https://github.com/scarfacedeb
|
659
669
|
[@mikegee]: https://github.com/mikegee
|
670
|
+
[@tycoon]: https://github.com/tycooon
|
data/lib/http/chainable.rb
CHANGED
@@ -70,12 +70,21 @@ module HTTP
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# Make an HTTP request with the given verb
|
73
|
+
# @param verb
|
73
74
|
# @param uri
|
74
75
|
# @option options [Hash]
|
75
76
|
def request(verb, uri, options = {}) # rubocop:disable Style/OptionHash
|
76
77
|
branch(options).request verb, uri
|
77
78
|
end
|
78
79
|
|
80
|
+
# Prepare an HTTP request with the given verb
|
81
|
+
# @param verb
|
82
|
+
# @param uri
|
83
|
+
# @option options [Hash]
|
84
|
+
def build_request(verb, uri, options = {}) # rubocop:disable Style/OptionHash
|
85
|
+
branch(options).build_request verb, uri
|
86
|
+
end
|
87
|
+
|
79
88
|
# @overload timeout(options = {})
|
80
89
|
# Syntax sugar for `timeout(:per_operation, options)`
|
81
90
|
# @overload timeout(klass, options = {})
|
data/lib/http/client.rb
CHANGED
@@ -25,13 +25,25 @@ module HTTP
|
|
25
25
|
|
26
26
|
# Make an HTTP request
|
27
27
|
def request(verb, uri, opts = {}) # rubocop:disable Style/OptionHash
|
28
|
+
opts = @default_options.merge(opts)
|
29
|
+
req = build_request(verb, uri, opts)
|
30
|
+
res = perform(req, opts)
|
31
|
+
return res unless opts.follow
|
32
|
+
|
33
|
+
Redirector.new(opts.follow).perform(req, res) do |request|
|
34
|
+
perform(request, opts)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Prepare an HTTP request
|
39
|
+
def build_request(verb, uri, opts = {}) # rubocop:disable Style/OptionHash
|
28
40
|
opts = @default_options.merge(opts)
|
29
41
|
uri = make_request_uri(uri, opts)
|
30
42
|
headers = make_request_headers(opts)
|
31
43
|
body = make_request_body(opts, headers)
|
32
44
|
proxy = opts.proxy
|
33
45
|
|
34
|
-
|
46
|
+
HTTP::Request.new(
|
35
47
|
:verb => verb,
|
36
48
|
:uri => uri,
|
37
49
|
:headers => headers,
|
@@ -39,13 +51,6 @@ module HTTP
|
|
39
51
|
:body => body,
|
40
52
|
:auto_deflate => opts.feature(:auto_deflate)
|
41
53
|
)
|
42
|
-
|
43
|
-
res = perform(req, opts)
|
44
|
-
return res unless opts.follow
|
45
|
-
|
46
|
-
Redirector.new(opts.follow).perform(req, res) do |request|
|
47
|
-
perform(request, opts)
|
48
|
-
end
|
49
54
|
end
|
50
55
|
|
51
56
|
# @!method persistent?
|
data/lib/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-04-
|
14
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: http_parser.rb
|