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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a096aa1b9d5191761bbd4cc1205b371038bac039e7b7eff2bf1a95d25f4cc20
4
- data.tar.gz: 9c27c29310fda99f663a2c52dddab4bf1541e51b34c74cd6fac7b0c34f0b8eae
3
+ metadata.gz: 853087de359024f397422b0563f0232edfa247c2f201a060c10b7b8ea9aff00b
4
+ data.tar.gz: b07ad1d88da70f9d76c5e272923dab3ce763077a8f8f7cb9ee6c37602acb6bb5
5
5
  SHA512:
6
- metadata.gz: 5034ce467b1a9d72be5272a1c1aa1060e29a2c52badf1fbc413559c5027a36f0d052c7f9a69d6ef66d45aae814d57a44e022758908670d3e27aca650c6f957a2
7
- data.tar.gz: 48d814174b0d98a6d4722f144f423ab755eabf48cfb56246bbee6d2ab53dad3d37a162ce696a49a82c34d4de97469393b8668863a6ac8a4b611522c01204ac99
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 vresion backports one change we missed to backport in previous release:
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
@@ -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 = {})
@@ -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
- req = HTTP::Request.new(
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP
4
- VERSION = "3.2.1"
4
+ VERSION = "3.3.0"
5
5
  end
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.2.1
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-24 00:00:00.000000000 Z
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