From: Vsevolod Stakhov Date: Tue, 23 Apr 2019 14:28:19 +0000 (+0100) Subject: [Fix] Fix issue with urls with no tld (e.g. IP) X-Git-Tag: 1.9.3~85 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=babeb8beaa4560f0a273cc193d739df05b94db49;p=rspamd.git [Fix] Fix issue with urls with no tld (e.g. IP) --- diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index afdc2f0aa..7482da01e 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -674,7 +674,9 @@ local function clickhouse_collect(task) end -- Get tlds - table.insert(row, flatten_urls(function(_,u) return u:get_tld() end, urls_urls)) + table.insert(row, flatten_urls(function(_, u) + return u:get_tld() or u:get_host() + end, urls_urls)) -- Get hosts/full urls table.insert(row, flatten_urls(function(k, _) return k end, urls_urls)) else