aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_maps.lua
diff options
context:
space:
mode:
authordpetrov67 <dpetrov67@gmail.com>2023-02-14 11:19:57 -0500
committerGitHub <noreply@github.com>2023-02-14 11:19:57 -0500
commit7797592bedd63ce3c2ffecb944695ed63c837dd7 (patch)
tree4dac18843759ab0096d7370dc6bfb44466ef99b2 /lualib/lua_maps.lua
parentf89cb1d6acbdfde6aacf9878eacb3faf6a22a1d3 (diff)
downloadrspamd-7797592bedd63ce3c2ffecb944695ed63c837dd7.tar.gz
rspamd-7797592bedd63ce3c2ffecb944695ed63c837dd7.zip
Fix support for global maps in lua_maps.lua
Diffstat (limited to 'lualib/lua_maps.lua')
-rw-r--r--lualib/lua_maps.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/lualib/lua_maps.lua b/lualib/lua_maps.lua
index 362f54365..e3ce2af20 100644
--- a/lualib/lua_maps.lua
+++ b/lualib/lua_maps.lua
@@ -510,21 +510,18 @@ local function rspamd_maybe_check_map(key, what)
end
if type(rspamd_maps) == "table" then
local mn
- if starts(what, "map:") then
- mn = string.sub(what, 4)
- elseif starts(what, "map://") then
- mn = string.sub(what, 6)
+ if starts(key, "map:") then
+ mn = string.sub(key, 5)
+ elseif starts(key, "map://") then
+ mn = string.sub(key, 7)
end
if mn and rspamd_maps[mn] then
- return rspamd_maps[mn]:get_key(key)
- else
- return what:lower() == key
+ return rspamd_maps[mn]:get_key(what)
end
- else
- return what:lower() == key
end
+ return what:lower() == key
end
exports.rspamd_maybe_check_map = rspamd_maybe_check_map