diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-23 16:10:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-23 16:10:48 +0100 |
commit | e6556d52c29bc350b20bea5480726eb98c460639 (patch) | |
tree | 39bb9ecd8a18ff5c395c7885f3465c7e7ef0b5a5 /lualib | |
parent | 1d5ddb1345f757a3af4cfde6a5213ac751d29baf (diff) | |
download | rspamd-e6556d52c29bc350b20bea5480726eb98c460639.tar.gz rspamd-e6556d52c29bc350b20bea5480726eb98c460639.zip |
[Minor] Lua_selectors: Add optional shadow result name
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_selectors/extractors.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua index c01a07f4b..c40b93b3b 100644 --- a/lualib/lua_selectors/extractors.lua +++ b/lualib/lua_selectors/extractors.lua @@ -418,16 +418,18 @@ The first argument must be header name.]], -- Get specific symbol ['symbol'] = { ['get_value'] = function(task, args) - local symbol = task:get_symbol(args[1]) + local symbol = task:get_symbol(args[1], args[2]) if symbol then return symbol[1],'table' end end, ['description'] = 'Get specific symbol. The first argument must be the symbol name. ' .. + 'The second argument is an optional shadow result name. ' .. 'Returns the symbol table. See task:get_symbol()', - ['args_schema'] = {ts.string} + ['args_schema'] = {ts.string, ts.string:is_optional()} }, + } return extractors |