Skip to content

Commit

Permalink
hotfix(rate-limiting) correct length of year
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thibaultcha committed Feb 1, 2017
1 parent f8f5306 commit e4fdb2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kong/plugins/rate-limiting/policies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local EXPIRATIONS = {
hour = 3600,
day = 86400,
month = 2592000,
year = 31104000
year = 31536000,
}

return {
Expand Down
4 changes: 2 additions & 2 deletions kong/plugins/response-ratelimiting/policies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local EXPIRATIONS = {
hour = 3600,
day = 86400,
month = 2592000,
year = 31104000
year = 31536000,
}

return {
Expand Down Expand Up @@ -143,4 +143,4 @@ return {
return current_metric and current_metric or 0
end
}
}
}

0 comments on commit e4fdb2a

Please sign in to comment.