From a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 1 Feb 2017 18:28:30 +0200 Subject: [PATCH] [Feature] Add `rip` keyword to ratelimit module --- src/plugins/lua/ratelimit.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index c532e4379..d1503f3c3 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -113,6 +113,13 @@ local keywords = { return nil end, }, + ['rip'] = { + ['get_value'] = function(task) + local ip = task:get_ip() + if ip and ip:is_valid() and not ip:is_local() then return ip end + return nil + end, + }, ['from'] = { ['get_value'] = function(task) local from = task:get_from(0) -- 2.39.5