diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-09 16:37:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-09 16:37:33 +0100 |
commit | a8f04e06d0900487f99caecf8b421f1ee25e5c03 (patch) | |
tree | 19983c63fa9670f8eef0c2f5046f76d64cc4b2af | |
parent | 04abba6b321214191d9f3d1e87695d14405af196 (diff) | |
parent | 8853969f24c8f0dd1da7f7689a1eb73a9ecef76c (diff) | |
download | rspamd-a8f04e06d0900487f99caecf8b421f1ee25e5c03.tar.gz rspamd-a8f04e06d0900487f99caecf8b421f1ee25e5c03.zip |
Merge pull request #940 from fatalbanana/rlimit
[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 |