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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a07874f78e22e8d5050980f2c9bc898bb95a0cf7
4
- data.tar.gz: 11853fc0cee6e4f6ec2f5b1bf13d0ad156085861
3
+ metadata.gz: 028b29e92d03433bc4550ef3b8a5372de4f02221
4
+ data.tar.gz: 65ebbad4d0b0dcde83a9147b0f2682341fb36e3f
5
5
  SHA512:
6
- metadata.gz: a2599aea8d7c5a25f98bb4795bdeaca42de935afac3fce0ae1b705a53ff8bb82cfbe6fc8c76af1c3dcd7f68719af45e76c97f94b58dabec2eb1523c108a5397b
7
- data.tar.gz: 5d7c7cab7d3ef0e594400a8c56e60943899da1122263f376bc602dad2dec88037f08cadf26de006b464bd3082445e6d403ddb76c2fc3f9a70f2c62db4130119a
6
+ metadata.gz: 33d8a20eff08d9a80173de52e46df0cb6507b6f9a275fd5bfe276a6ea58630b0f47591cb56fdd19967c3081cf65908fcf33b26bdc5e230b62c98cfdbb5f61675
7
+ data.tar.gz: 2ec7763bcc9ef1e9594838f7a24657c7c6ffe933e898654fc4da6b72e12a9c1b78058d21a11dc8462a002f8649ca7dbdc732295681f041721ede2312547cfac7
@@ -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 - pos)..-1]
210
+ compressed[(@pos - (@data.length - compressed.length))..-1]
212
211
  else
213
212
  ""
214
213
  end
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  class HttpRequest
3
- VERSION = "1.1.4"
3
+ VERSION = "1.1.5"
4
4
  end
5
5
  end
@@ -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
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-06-06 00:00:00.000000000 Z
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable