em-http-request 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of em-http-request might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/em-http/decoders.rb +1 -2
- data/lib/em-http/version.rb +1 -1
- data/spec/gzip_spec.rb +23 -0
- 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: 028b29e92d03433bc4550ef3b8a5372de4f02221
|
4
|
+
data.tar.gz: 65ebbad4d0b0dcde83a9147b0f2682341fb36e3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d8a20eff08d9a80173de52e46df0cb6507b6f9a275fd5bfe276a6ea58630b0f47591cb56fdd19967c3081cf65908fcf33b26bdc5e230b62c98cfdbb5f61675
|
7
|
+
data.tar.gz: 2ec7763bcc9ef1e9594838f7a24657c7c6ffe933e898654fc4da6b72e12a9c1b78058d21a11dc8462a002f8649ca7dbdc732295681f041721ede2312547cfac7
|
data/lib/em-http/decoders.rb
CHANGED
@@ -127,7 +127,6 @@ module EventMachine::HttpDecoders
|
|
127
127
|
|
128
128
|
def extract_stream(compressed)
|
129
129
|
@data << compressed
|
130
|
-
pos = @pos
|
131
130
|
|
132
131
|
while !eof? && !finished?
|
133
132
|
buffer = ""
|
@@ -208,7 +207,7 @@ module EventMachine::HttpDecoders
|
|
208
207
|
end
|
209
208
|
|
210
209
|
if finished?
|
211
|
-
compressed[(@pos -
|
210
|
+
compressed[(@pos - (@data.length - compressed.length))..-1]
|
212
211
|
else
|
213
212
|
""
|
214
213
|
end
|
data/lib/em-http/version.rb
CHANGED
data/spec/gzip_spec.rb
CHANGED
@@ -56,6 +56,29 @@ describe EventMachine::HttpDecoders::GZip do
|
|
56
56
|
decompressed.size.should eq(32907)
|
57
57
|
end
|
58
58
|
|
59
|
+
it "should not care how many chunks the file is split up into" do
|
60
|
+
examples = [
|
61
|
+
["\x1F", "\x8B", "\b", "\x00", "\x00", "\x00", "\x00", "\x00", "\x00", "\x00", "\xF3", "\xCB", "/", "Q", "p\xCB/\xCDK\x01\x00M\x8Ct\xB1\t\x00\x00\x00"],
|
62
|
+
["\x1F", "\x8B", "\b", "\x00", "\x00", "\x00", "\x00", "\x00\x00\x00\xF3\xCB/Qp\xCB/\xCDK\x01\x00M\x8Ct\xB1\t\x00\x00\x00"]
|
63
|
+
]
|
64
|
+
|
65
|
+
examples.each do |example|
|
66
|
+
decompressed = ""
|
67
|
+
|
68
|
+
gz = EventMachine::HttpDecoders::GZip.new do |data|
|
69
|
+
decompressed << data
|
70
|
+
end
|
71
|
+
|
72
|
+
example.each do |bytes|
|
73
|
+
gz << bytes
|
74
|
+
end
|
75
|
+
|
76
|
+
gz.finalize!
|
77
|
+
|
78
|
+
decompressed.should eq("Not Found")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
59
82
|
it "should fail with a DecoderError if not a gzip file" do
|
60
83
|
not_a_gzip = ["1f8c08089668a650000"].pack("H*")
|
61
84
|
header = EventMachine::HttpDecoders::GZipHeader.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-http-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Grigorik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|