diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-21 15:52:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-21 17:58:51 +0100 |
commit | 6b676918bbb037c111fa2616f1709ead9ac3c788 (patch) | |
tree | 5d5dfeed936482f5431eac4e0428746a90885678 /test | |
parent | e971c539fa763d3f632735ec59f1d5e50685467f (diff) | |
download | rspamd-6b676918bbb037c111fa2616f1709ead9ac3c788.tar.gz rspamd-6b676918bbb037c111fa2616f1709ead9ac3c788.zip |
[Rework] Drop url tags
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/lua/url_tags.lua | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/test/functional/lua/url_tags.lua b/test/functional/lua/url_tags.lua deleted file mode 100644 index 9dc38ac72..000000000 --- a/test/functional/lua/url_tags.lua +++ /dev/null @@ -1,56 +0,0 @@ - -local rspamd_logger = require 'rspamd_logger' - -rspamd_config:register_symbol({ - name = 'ADDED_TAGS', - score = 1.0, - callback = function(task) - if not task:get_request_header('addtags') then - return true, 'nope! not requested' - end - local urls = task:get_urls() - if not (urls and urls[1]) then - return true, 'nope! found no urls' - end - local mpool = task:get_mempool() - for _, u in ipairs(urls) do - u:add_tag('test1', 'meta1', mpool) - u:add_tag('test1', 'meta2', mpool) - u:add_tag('test2', 'http://www.example.com', mpool) - end - return true, 'no worry' - end -}) - -rspamd_config:register_symbol({ - name = 'FOUND_TAGS', - score = 1.0, - callback = function(task) - local urls = task:get_urls() - if not (urls and urls[1]) then - return true, 'nope! found no urls' - end - for _, u in ipairs(urls) do - local tags = u:get_tags() - rspamd_logger.debugx(task, 'tags: %1', tags) - if not tags['test1'] then - return true, 'no key - test1' - end - local found1, found2 = false, false - for _, e in ipairs(tags['test1']) do - if e == 'meta1' then found1 = true end - if e == 'meta2' then found2 = true end - end - if not (found1 and found2) then - return true, 'missing metatags in test1' - end - if not tags['test2'] then - return true, 'no key - test2' - end - if not tags['test2'][1] == 'http://www.example.com' then - return true, 'wrong value in test2 metatag: ' .. tags['test2'][1] - end - end - return true, 'no worry' - end -}) |