From e4fdb2a3af4a5f2bf298c7b6488d88e67288c98b Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Tue, 31 Jan 2017 16:49:34 -0800 Subject: [PATCH] hotfix(rate-limiting) correct length of year A year was incorrectly assumed to have 360 days. This change assumes a year has 365 days. Thanks Cooper Marcus for the initial fix. Fix #2021 Replaces #2025 --- kong/plugins/rate-limiting/policies.lua | 2 +- kong/plugins/response-ratelimiting/policies.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kong/plugins/rate-limiting/policies.lua b/kong/plugins/rate-limiting/policies.lua index 16b28311e87..01c64f14e58 100644 --- a/kong/plugins/rate-limiting/policies.lua +++ b/kong/plugins/rate-limiting/policies.lua @@ -17,7 +17,7 @@ local EXPIRATIONS = { hour = 3600, day = 86400, month = 2592000, - year = 31104000 + year = 31536000, } return { diff --git a/kong/plugins/response-ratelimiting/policies.lua b/kong/plugins/response-ratelimiting/policies.lua index 8d3e8ee9d11..f2511bc3780 100644 --- a/kong/plugins/response-ratelimiting/policies.lua +++ b/kong/plugins/response-ratelimiting/policies.lua @@ -17,7 +17,7 @@ local EXPIRATIONS = { hour = 3600, day = 86400, month = 2592000, - year = 31104000 + year = 31536000, } return { @@ -143,4 +143,4 @@ return { return current_metric and current_metric or 0 end } -} \ No newline at end of file +}