commit babeb8b: [Fix] Fix issue with urls with no tld (e.g. IP)

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Apr 23 14:35:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-04-23 15:28:19 +0100
URL: https://github.com/rspamd/rspamd/commit/babeb8beaa4560f0a273cc193d739df05b94db49 (HEAD -> master)

[Fix] Fix issue with urls with no tld (e.g. IP)

---
 src/plugins/lua/clickhouse.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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


More information about the Commits mailing list