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 +4 -4
- data/lib/dap/filter/http.rb +2 -0
- data/lib/dap/version.rb +1 -1
- data/spec/dap/filter/http_filter_spec.rb +12 -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: b119da99eec7c7e49a870110c1af855f004a38ce
|
4
|
+
data.tar.gz: 556852867c42e3652559f891b9cc64655619fbbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e29f834d07bd0d02cb03ec4b047c47987ae585f6ebf7bfc6782c40acd30e99fbfc64b550e5497f65b50b0fc6461bd58cf581f7bcdf2c1f1cb6d5d2b8e98c3be2
|
7
|
+
data.tar.gz: c846f6ebf2ec60baad6c8943ebf401ee4715e0995717d6bc897c27a2883fecb4af02951d649d20fff2154a9f1b74879726f5a3a6f74155a2cecb5b08b1c6c9ae
|
data/lib/dap/filter/http.rb
CHANGED
@@ -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")
|
data/lib/dap/version.rb
CHANGED
@@ -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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Eub3JnCkNsaWVudC1TU0wtQ2lwaGVyOiBBRVMxMjgtU0hBCkNsaWVudC1TU0wtU29ja2V0LUNsYXNzOiBJTzo6U29ja2V0OjpTU0wKQ2xpZW50LVNTTC1XYXJuaW5nOiBQZWVyIGNlcnRpZmljYXRlIG5vdCB2ZXJpZmllZApTdHJpY3QtVHJhbnNwb3J0LVNlY3VyaXR5OiBtYXgtYWdlPTMxNTM2MDAwOyBpbmNsdWRlU3ViRG9tYWluczsgcHJlbG9hZApUaW1pbmctQWxsb3ctT3JpZ2luOiAqClgtQW5hbHl0aWNzOiBodHRwcz0xO25vY29va2llcz0xClgtQ2FjaGU6IGNwMTA3MSBoaXQvOSwgY3AyMDIwIGhpdC8yLCBjcDQwMDUgbWlzcywgY3A0MDE1IGhpdC84ODg3ClgtQ2FjaGUtU3RhdHVzOiBoaXQKWC1DbGllbnQtSVA6IDE3My4xNy43OS41NApYLU9iamVjdC1NZXRhLVNoYTFiYXNlMzY6IDFxNG5hMXhqNnRvcHpsbjUxdHB6cXF4dGR0ZHdvOXAKWC1UaW1lc3RhbXA6IDEzODExMDM2NjQuMDg2NDMKWC1UcmFucy1JZDogdHgzZDZmMmU1NzQ0MGM0NzA4YTI0ZjgtMDA1OGQ4NWE1YgpYLVZhcm5pc2g6IDYwMTIxMjI1IDU4NDE4ODgsIDQ3NzczOTUyIDM4MjY4MDcwLCA3MDcxNjg5NiwgNDM2MzkyNTAwIDE4MjE4MjgwMwoKiVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII".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.
|
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-
|
11
|
+
date: 2017-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|