Delete host aliases if empty

This commit is contained in:
Alfredo Cardigliano 2023-11-03 16:03:07 +01:00
parent 1e42102297
commit 891acbd895
2 changed files with 16 additions and 7 deletions

View file

@ -830,7 +830,13 @@ function setHostAltName(host_info, alt_name)
host_key = host_info
end
ntop.setCache(getHostAltNamesKey(host_key), alt_name)
local key = getHostAltNamesKey(host_key)
if isEmptyString(alt_name) then
ntop.delCache(key)
else
ntop.setCache(key, alt_name)
end
end
-- ##############################################