Fixes external link url proto not correctly used (#6626)

This commit is contained in:
MatteoBiscosi 2022-05-25 12:52:56 +02:00
parent 0ac8da733f
commit 6921aa9dce
4 changed files with 14 additions and 8 deletions

View file

@ -58,7 +58,10 @@ function alert_ndpi_suspicious_dga_domain.format(ifid, alert, alert_type_params)
url = url:gsub('https', '')
end
href = i18n('external_link_url', { url = url, url_name = shortenString(url, 32)})
local proto = string.lower(interface.getnDPIProtoName(tonumber(alert["l7_master_proto"])))
proto = ternary(((proto) and (proto == 'http')), 'http', 'https')
href = i18n('external_link_url', { url = url, url_name = shortenString(url, 32), proto = proto })
end
return i18n("alert_messages.suspicious_dga_domain", {