]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix issue with urls with no tld (e.g. IP)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Apr 2019 14:28:19 +0000 (15:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Apr 2019 14:28:19 +0000 (15:28 +0100)
src/plugins/lua/clickhouse.lua

index afdc2f0aaffee746122c80e947fdd8f9d978cf99..7482da01eba9e5f1a22af066c9faaeb6cdb77d0d 100644 (file)
@@ -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