http 5.0.0.pre2 → 5.0.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbaa69332ed43468d3388aa291c39b50104981ab648b25b3de6afe9f6272242d
4
- data.tar.gz: 4d8aa977a340af1da8b7ce8386c66a37a48a13c4d50f36fdfc0ef7db09837132
3
+ metadata.gz: d09142fafcb9b5715621ad330639c7c03ea5b280d6a7d1024029bb1125d1db1e
4
+ data.tar.gz: 48d33d13b9009d302de0b7cefa097e2891032ac8b961a803441776908b707531
5
5
  SHA512:
6
- metadata.gz: 12fdc45dc637e65dcda24a1e3c056a3f215d87229d60c8997b2c4c63754d4ac21c5872f4dddd03b2061b5ee2767e3558370fe7e0506b73444e09f730f5e6101d
7
- data.tar.gz: 45af15139df31af3f99b31c5b554ad225c793d65c2b8506dd8b6469ee79be201832cdaa1bd22c510671fcdd3febf2b9844b168d18ef5b0ed9cc2cff7f83975f9
6
+ metadata.gz: 9e446e54d2066969541b1ef5593aed989d1ff0b0d7228bf56ab61483dab1e52374bca34792c616930b689d1c684ab09694e49b07dce0b6e2bdc2d82de3504ebc
7
+ data.tar.gz: bc2877d15a9e06c3b105aa542da78f0497eee9bc81f26fd07867cef3f4be3d1b005060ff4e4d95133442cbd6b5edefb6adc39a4c04cb54fdcb8b91852de3036b
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## future is unwritten (master)
2
2
 
3
+ * [#593](https://github.com/httprb/http/pull/593)
4
+ [#592](https://github.com/httprb/http/issues/592)
5
+ Support informational (1XX) responses.
6
+ ([@ixti])
7
+
3
8
  * [#590](https://github.com/httprb/http/pull/590)
4
9
  [#589](https://github.com/httprb/http/issues/589)
5
10
  Fix response headers paring.
data/README.md CHANGED
@@ -168,6 +168,7 @@ versions:
168
168
  * Ruby 2.4.x
169
169
  * Ruby 2.5.x
170
170
  * Ruby 2.6.x
171
+ * Ruby 2.7.x
171
172
  * JRuby 9.2.x.x
172
173
 
173
174
  If something doesn't work on one of these versions, it's a bug.
@@ -86,7 +86,11 @@ module HTTP
86
86
  end
87
87
 
88
88
  def on_message_complete(_response)
89
- @finished[:message] = true
89
+ if @state.http_status < 200
90
+ reset
91
+ else
92
+ @finished[:message] = true
93
+ end
90
94
  end
91
95
 
92
96
  def reset
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP
4
- VERSION = "5.0.0.pre2"
4
+ VERSION = "5.0.0.pre3"
5
5
  end
@@ -42,4 +42,33 @@ RSpec.describe HTTP::Response::Parser do
42
42
  expect(subject.read(expected_body.size)).to eq(expected_body)
43
43
  end
44
44
  end
45
+
46
+ context "when got 100 Continue response" do
47
+ let :raw_response do
48
+ "HTTP/1.1 100 Continue\r\n\r\n" \
49
+ "HTTP/1.1 200 OK\r\n" \
50
+ "Content-Length: 12\r\n\r\n" \
51
+ "Hello World!"
52
+ end
53
+
54
+ context "when response is feeded in one part" do
55
+ let(:parts) { [raw_response] }
56
+
57
+ it "skips to next non-info response" do
58
+ expect(subject.status_code).to eq(200)
59
+ expect(subject.headers).to eq("Content-Length" => "12")
60
+ expect(subject.read(12)).to eq("Hello World!")
61
+ end
62
+ end
63
+
64
+ context "when response is feeded in many parts" do
65
+ let(:parts) { raw_response.split(//) }
66
+
67
+ it "skips to next non-info response" do
68
+ expect(subject.status_code).to eq(200)
69
+ expect(subject.headers).to eq("Content-Length" => "12")
70
+ expect(subject.read(12)).to eq("Hello World!")
71
+ end
72
+ end
73
+ end
45
74
  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: 5.0.0.pre2
4
+ version: 5.0.0.pre3
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: 2020-01-23 00:00:00.000000000 Z
14
+ date: 2020-02-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
@@ -187,7 +187,7 @@ metadata:
187
187
  source_code_uri: https://github.com/httprb/http
188
188
  wiki_uri: https://github.com/httprb/http/wiki
189
189
  bug_tracker_uri: https://github.com/httprb/http/issues
190
- changelog_uri: https://github.com/httprb/http/blob/v5.0.0.pre2/CHANGES.md
190
+ changelog_uri: https://github.com/httprb/http/blob/v5.0.0.pre3/CHANGES.md
191
191
  post_install_message:
192
192
  rdoc_options: []
193
193
  require_paths:
@@ -203,7 +203,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: 1.3.1
205
205
  requirements: []
206
- rubygems_version: 3.1.2
206
+ rubyforge_project:
207
+ rubygems_version: 2.7.6.2
207
208
  signing_key:
208
209
  specification_version: 4
209
210
  summary: HTTP should be easy