http 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/lib/http/response.rb +2 -3
- data/lib/http/response/body.rb +3 -3
- data/lib/http/response/inflater.rb +2 -0
- data/lib/http/version.rb +1 -1
- data/spec/lib/http/response/body_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9dcdebfa768fef6850eb95f309e613e7dabff6e
|
4
|
+
data.tar.gz: ef6556edd618dc48d214b6e4dd0b3eae123a2640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c5b7284269683e79dc40f00784745498483ba98a9931ff1fcdd9141fdfeb77bddd96e29ee086c8611536ef6498456deb390afe64a138816f84eb347aaacd5a1
|
7
|
+
data.tar.gz: 4d6fd7a909cffcbd7618fae1cebf984de0d3a85753725ac79997febfa46f67526f9d0e0eb2dd9e605d6809ad686acc00fba98f9ada46fb2f8b67d125c6b233bc
|
data/CHANGES.md
CHANGED
data/lib/http/response.rb
CHANGED
@@ -48,10 +48,9 @@ module HTTP
|
|
48
48
|
if opts.include?(:connection)
|
49
49
|
connection = opts.fetch(:connection)
|
50
50
|
encoding = opts[:encoding] || charset || Encoding::BINARY
|
51
|
+
stream = body_stream_for(connection, opts)
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
@body = Response::Body.new(connection, stream, encoding)
|
53
|
+
@body = Response::Body.new(stream, encoding)
|
55
54
|
else
|
56
55
|
@body = opts.fetch(:body)
|
57
56
|
end
|
data/lib/http/response/body.rb
CHANGED
@@ -15,11 +15,11 @@ module HTTP
|
|
15
15
|
# @return [HTTP::Connection]
|
16
16
|
attr_reader :connection
|
17
17
|
|
18
|
-
def initialize(
|
19
|
-
@
|
18
|
+
def initialize(stream, encoding = Encoding::BINARY)
|
19
|
+
@stream = stream
|
20
|
+
@connection = stream.is_a?(Inflater) ? stream.connection : stream
|
20
21
|
@streaming = nil
|
21
22
|
@contents = nil
|
22
|
-
@stream = stream
|
23
23
|
@encoding = encoding
|
24
24
|
end
|
25
25
|
|
data/lib/http/version.rb
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe HTTP::Response::Body do
|
|
5
5
|
|
6
6
|
before { allow(connection).to receive(:readpartial) { chunks.shift } }
|
7
7
|
|
8
|
-
subject(:body) { described_class.new(connection,
|
8
|
+
subject(:body) { described_class.new(connection, Encoding::UTF_8) }
|
9
9
|
|
10
10
|
it "streams bodies from responses" do
|
11
11
|
expect(subject.to_s).to eq("Hello, World!")
|
@@ -47,7 +47,7 @@ RSpec.describe HTTP::Response::Body do
|
|
47
47
|
end
|
48
48
|
subject(:body) do
|
49
49
|
inflater = HTTP::Response::Inflater.new(connection)
|
50
|
-
described_class.new(
|
50
|
+
described_class.new(inflater, Encoding::UTF_8)
|
51
51
|
end
|
52
52
|
|
53
53
|
it "decodes body" do
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
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: 2017-02-
|
14
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: http_parser.rb
|