This commit is contained in:
Nicolo Maio 2023-07-11 08:18:23 +00:00
parent d3b97fdaaf
commit 52e9fcf8a2
3 changed files with 24 additions and 29 deletions

View file

@ -17,20 +17,12 @@ end
local host = _GET["host"]
local scan_type = _GET["scan_type"]
tprint("HERE1")
if isEmptyString(host) or isEmptyString(scan_type) then
rest_utils.answer(rest_utils.consts.err.invalid_args)
end
local result = retrieve_host_scan_result(host, scan_type)
if result == {} then
tprint("HERE2")
rest_utils.answer(rest_utils.consts.success.ok, result )
else
local extra_headers = {}
tprint("HERE3")
extra_headers["Content-Disposition"] = "attachment;filename=\"scan_result_export_"..os.time()..".txt\""
rest_utils.vanilla_payload_response(rest_utils.consts.success.ok, result, "application/octet-stream", extra_headers)
end
local extra_headers = {}
extra_headers["Content-Disposition"] = "attachment;filename=\"scan_result_export_"..os.time()..".txt\""
rest_utils.vanilla_payload_response(rest_utils.consts.success.ok, result, "application/octet-stream", extra_headers)