dap 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 78d24bb7f83c5edce062ad60c427822ccc896723
4
- data.tar.gz: 3b62b7361c6cdaa5e2ac94a8ee76d2e18eba8431
3
+ metadata.gz: b119da99eec7c7e49a870110c1af855f004a38ce
4
+ data.tar.gz: 556852867c42e3652559f891b9cc64655619fbbd
5
5
  SHA512:
6
- metadata.gz: 22aaf4462af2fe4d18bfb4ed0cc8d85dfbb34dedbcf263a0b99e76d57663d5f4a79f9b8c42618df862ddff0155bfa609e9c3c9ff1d5995240901afc83c760171
7
- data.tar.gz: 9ccfacb005c24d24a97f79dd6cc9e5f84cfa4ec1e6aab5a307554d3ce015973e023997dedc995c3d2fdc6bda8671f97208400d3bed06ec65dd75a291e1152ceb
6
+ metadata.gz: e29f834d07bd0d02cb03ec4b047c47987ae585f6ebf7bfc6782c40acd30e99fbfc64b550e5497f65b50b0fc6461bd58cf581f7bcdf2c1f1cb6d5d2b8e98c3be2
7
+ data.tar.gz: c846f6ebf2ec60baad6c8943ebf401ee4715e0995717d6bc897c27a2883fecb4af02951d649d20fff2154a9f1b74879726f5a3a6f74155a2cecb5b08b1c6c9ae
@@ -203,6 +203,8 @@ class FilterDecodeHTTPReply
203
203
  # Some buggy systems exclude the header entirely
204
204
  body ||= head
205
205
 
206
+ save["http_raw_body"] = [body].pack("m*").gsub(/\s+/n, "")
207
+
206
208
  content_encoding = save["http_raw_headers"]["content-encoding"]
207
209
 
208
210
  if content_encoding && content_encoding.include?("gzip")
@@ -1,3 +1,3 @@
1
1
  module Dap
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -44,6 +44,18 @@ describe Dap::Filter::FilterDecodeHTTPReply do
44
44
  end
45
45
  end
46
46
 
47
+ context 'decoding binary response' do
48
+ # this represents the HTTP response for an HTTP/1.1 request for
49
+ # https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png, which you
50
+ # can replicate with something like
51
+ # echo -n "HTTP/1.1 `lwp-request -sem GET https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png`" | base64
52
+ let(:decode) { filter.decode("SFRUUC8xLjEgMjAwIE9LCkNvbm5lY3Rpb246IGNsb3NlCkRhdGU6IFR1ZSwgMjggTWFyIDIwMTcgMTc6MTg6NTQgR01UClZpYTogMS4xIHZhcm5pc2gtdjQsIDEuMSB2YXJuaXNoLXY0LCAxLjEgdmFybmlzaC12NCwgMS4xIHZhcm5pc2gtdjQKQWNjZXB0LVJhbmdlczogYnl0ZXMKQWdlOiAxNDc2MTkKRVRhZzogNzFhNTBkYmJhNDRjNzgxMjhiMjIxYjdkZjdiYjUxZjEKQ29udGVudC1MZW5ndGg6IDk1CkNvbnRlbnQtVHlwZTogaW1hZ2UvcG5nCkxhc3QtTW9kaWZpZWQ6IFN1biwgMDYgT2N0IDIwMTMgMjM6NTQ6MjUgR01UCkFjY2Vzcy1Db250cm9sLUFsbG93LU9yaWdpbjogKgpBY2Nlc3MtQ29udHJvbC1FeHBvc2UtSGVhZGVyczogQWdlLCBEYXRlLCBDb250ZW50LUxlbmd0aCwgQ29udGVudC1SYW5nZSwgWC1Db250ZW50LUR1cmF0aW9uLCBYLUNhY2hlLCBYLVZhcm5pc2gKQ2xpZW50LURhdGU6IFR1ZSwgMjggTWFyIDIwMTcgMTc6MTg6NTQgR01UCkNsaWVudC1QZWVyOiAxOTguMzUuMjYuMTEyOjQ0MwpDbGllbnQtUmVzcG9uc2UtTnVtOiAxCkNsaWVudC1TU0wtQ2VydC1Jc3N1ZXI6IC9DPUJFL089R2xvYmFsU2lnbiBudi1zYS9DTj1HbG9iYWxTaWduIE9yZ2FuaXphdGlvbiBWYWxpZGF0aW9uIENBIC0gU0hBMjU2IC0gRzIKQ2xpZW50LVNTTC1DZXJ0LVN1YmplY3Q6IC9DPVVTL1NUPUNhbGlmb3JuaWEvTD1TYW4gRnJhbmNpc2NvL089V2lraW1lZGlhIEZvdW5kYXRpb24sIEluYy4vQ049Ki53aWtpcGVkaWEub3JnCkNsaWVudC1TU0wtQ2lwaGVyOiBBRVMxMjgtU0hBCkNsaWVudC1TU0wtU29ja2V0LUNsYXNzOiBJTzo6U29ja2V0OjpTU0wKQ2xpZW50LVNTTC1XYXJuaW5nOiBQZWVyIGNlcnRpZmljYXRlIG5vdCB2ZXJpZmllZApTdHJpY3QtVHJhbnNwb3J0LVNlY3VyaXR5OiBtYXgtYWdlPTMxNTM2MDAwOyBpbmNsdWRlU3ViRG9tYWluczsgcHJlbG9hZApUaW1pbmctQWxsb3ctT3JpZ2luOiAqClgtQW5hbHl0aWNzOiBodHRwcz0xO25vY29va2llcz0xClgtQ2FjaGU6IGNwMTA3MSBoaXQvOSwgY3AyMDIwIGhpdC8yLCBjcDQwMDUgbWlzcywgY3A0MDE1IGhpdC84ODg3ClgtQ2FjaGUtU3RhdHVzOiBoaXQKWC1DbGllbnQtSVA6IDE3My4xNy43OS41NApYLU9iamVjdC1NZXRhLVNoYTFiYXNlMzY6IDFxNG5hMXhqNnRvcHpsbjUxdHB6cXF4dGR0ZHdvOXAKWC1UaW1lc3RhbXA6IDEzODExMDM2NjQuMDg2NDMKWC1UcmFucy1JZDogdHgzZDZmMmU1NzQ0MGM0NzA4YTI0ZjgtMDA1OGQ4NWE1YgpYLVZhcm5pc2g6IDYwMTIxMjI1IDU4NDE4ODgsIDQ3NzczOTUyIDM4MjY4MDcwLCA3MDcxNjg5NiwgNDM2MzkyNTAwIDE4MjE4MjgwMwoKiVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII".unpack("m*").first) }
53
+
54
+ it 'correctly sets http_raw_body base64' do
55
+ expect(decode['http_raw_body']).to eq('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=')
56
+ end
57
+ end
58
+
47
59
  context 'decoding gzip compressed response' do
48
60
  let(:body) {
49
61
  io = StringIO.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rapid7 Research
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec