From 5a2c3912f544d80ab0bef982e6a2d5e4cacc9fd2 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Tue, 24 Jan 2017 11:47:51 +0200 Subject: [PATCH] [Minor] Small fix for friendly leak rates in ratelimit module --- src/plugins/lua/ratelimit.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index a9d3e65df..6791395de 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -560,11 +560,14 @@ if opts then -- new way of setting limits fun.each(function(t, lim) if type(lim) == 'table' then - settings[t] = lim - elseif type(lim) == 'string' then - local plim = parse_string_limit(lim) - if plim then - settings[t] = plim + if type(lim[2]) == 'number' then + settings[t] = lim + elseif type(lim[2]) == 'string' then + settings[t] = lim + local plim = parse_string_limit(lim[2]) + if plim then + settings[t][2] = plim + end end end end, opts['rates']) -- 2.39.5