diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-09-09 16:55:17 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-09-09 16:55:17 +0200 |
commit | 8853969f24c8f0dd1da7f7689a1eb73a9ecef76c (patch) | |
tree | 53e2934eb94d358d3b76e673826a6c4e272643ec | |
parent | 0625542be15f6e3a9cc6209ce544adaa2a51bc30 (diff) | |
download | rspamd-8853969f24c8f0dd1da7f7689a1eb73a9ecef76c.tar.gz rspamd-8853969f24c8f0dd1da7f7689a1eb73a9ecef76c.zip |
[Fix] Fix setting ratelimit key for 'ip' bucket
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index a4a870b09..9c6ff2ffe 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -305,6 +305,8 @@ local function make_rate_key(rtype, args) return string.format('%s:%s:%s', rl_prefix, rtype, args['asn']) elseif rtype == 'user' and args['user'] then return string.format('%s:%s:%s', rl_prefix, rtype, args['user']) + elseif rtype == 'ip' and args['ip'] and args['ip']:is_valid() then + return string.format('%s:%s', rl_prefix, args['ip']:to_string()) else return nil end |