Fix rate limiter
This commit is contained in:
parent
e3f41b338c
commit
0b748ed35b
|
@ -460,7 +460,7 @@ function getMinPow(name, req) {
|
|||
const ip = req.header('x-real-ip') || req.ip
|
||||
|
||||
// have a record for this ip?
|
||||
const { pow: lastPow = 0, tm = 0 } = ipNamePows.get(ip) || {};
|
||||
let { pow: lastPow = 0, tm = 0 } = ipNamePows.get(ip) || {};
|
||||
console.log("minPow", { name, ip, lastPow, tm, headers: req.headers });
|
||||
if (lastPow) {
|
||||
// refill: reduce the pow threshold once per passed period
|
||||
|
|
Loading…
Reference in New Issue
Block a user