Use x-real-ip for pow rate limiter

This commit is contained in:
artur 2024-02-09 15:37:50 +03:00
parent f22f7425dc
commit 67d5ccff80

View File

@ -457,7 +457,7 @@ function getMinPow(name, req) {
minPow += 4;
}
const ip = req.ip
const ip = req.header('x-real-ip')?.[0] || req.ip
// have a record for this ip?
const { pow: lastPow = 0, tm = 0 } = ipNamePows.get(ip) || {};