File tree Expand file tree Collapse file tree 2 files changed +107
-79
lines changed Expand file tree Collapse file tree 2 files changed +107
-79
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ def scan_export_status(scan_id, file_id)
180
180
if res . code == "200"
181
181
return "ready"
182
182
else
183
- res = JSON . parse ( resp . body )
183
+ res = JSON . parse ( res . body )
184
184
return res
185
185
end
186
186
end
@@ -206,8 +206,8 @@ def report_host_ports
206
206
raise NotImplementedError
207
207
end
208
208
209
- def report_download
210
- raise NotImplementedError
209
+ def report_download ( scan_id , file_id )
210
+ res = http_get ( :uri => "/scans/ #{ scan_id } /export/ #{ file_id } /download" , :raw_content => true , :fields => x_cookie )
211
211
end
212
212
213
213
private
@@ -256,6 +256,7 @@ def http_delete(opts={})
256
256
def http_get ( opts = { } )
257
257
uri = opts [ :uri ]
258
258
fields = opts [ :fields ] || { }
259
+ raw_content = opts [ :raw_content ] || false
259
260
json = { }
260
261
261
262
req = Net ::HTTP ::Get . new ( uri )
@@ -268,8 +269,11 @@ def http_get(opts={})
268
269
rescue URI ::InvalidURIError
269
270
return json
270
271
end
271
-
272
- parse_json ( res . body )
272
+ if !raw_content
273
+ parse_json ( res . body )
274
+ else
275
+ res . body
276
+ end
273
277
end
274
278
275
279
def http_post ( opts = { } )
You can’t perform that action at this time.
0 commit comments