diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-30 14:05:08 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-30 14:05:08 +0100 |
commit | d1ad30ae1aad11e4bde0d889d9fd19b1fe41c499 (patch) | |
tree | 561df3ef5eaafaa1463253435631a529ead6112e | |
parent | 35c422bdef9ed574445d20efa17f61079e826d5a (diff) | |
download | rspamd-d1ad30ae1aad11e4bde0d889d9fd19b1fe41c499.tar.gz rspamd-d1ad30ae1aad11e4bde0d889d9fd19b1fe41c499.zip |
[Minor] Another fix to extract_specific
-rw-r--r-- | lualib/lua_util.lua | 10 | ||||
-rw-r--r-- | test/lua/unit/lua_util.extract_specific_urls.lua | 1 |
2 files changed, 1 insertions, 10 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index b37ffd61d..39150dbe6 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -655,14 +655,6 @@ exports.filter_specific_urls = function (urls, params) if params.filter then urls = fun.totable(fun.filter(params.filter, urls)) end - if #urls <= params.limit and #urls <= params.esld_limit then - if params.task and not params.no_cache then - params.task:cache_set(cache_key, urls) - end - - return urls - end - -- Filter by tld: local tlds = {} local eslds = {} @@ -888,7 +880,7 @@ exports.extract_specific_urls = function(params_or_task, lim, need_emails, filte } end for k,v in pairs(default_params) do - if not params[k] then params[k] = v end + if type(params[k]) == 'nil' and v ~= nil then params[k] = v end end local urls = params.task:get_urls(params.need_emails) diff --git a/test/lua/unit/lua_util.extract_specific_urls.lua b/test/lua/unit/lua_util.extract_specific_urls.lua index 73491ecb3..8e225b8fa 100644 --- a/test/lua/unit/lua_util.extract_specific_urls.lua +++ b/test/lua/unit/lua_util.extract_specific_urls.lua @@ -102,7 +102,6 @@ context("Lua util - extract_specific_urls plain", function() "domain1.org", "domain2.org", "domain3.org", - "domain3.org", "test.com", } |