Fix ah_host download file name. (#7644)

This commit is contained in:
Nicolo Maio 2023-07-11 08:37:27 +00:00
parent 8b4f96bf94
commit ba88b7d4d9

View file

@ -38,8 +38,11 @@ for _key, _value in ipairs(alerts or {}) do
end -- for
if no_html then
local extra_headers = {}
extra_headers["Content-Disposition"] = "attachment;filename=\"am_host_alerts_export_" .. os.time() .. ".csv\""
res = am_alert_store:to_csv(res)
rest_utils.vanilla_payload_response(rc, res, "text/csv")
rest_utils.vanilla_payload_response(rc, res, "text/csv", extra_headers)
else
local data = {
records = res,