add ratelimit to error code list
This commit is contained in:
parent
a763bde1f8
commit
21cfc8218b
@ -3,5 +3,6 @@
|
|||||||
403: login error (no cookie)
|
403: login error (no cookie)
|
||||||
404: invalid url / not found
|
404: invalid url / not found
|
||||||
410-419: argument/data error
|
410-419: argument/data error
|
||||||
|
429: ratelimit
|
||||||
|
|
||||||
500: server error
|
500: server error
|
@ -295,6 +295,7 @@ function increaseIndividualCall(url, req) {
|
|||||||
}
|
}
|
||||||
INDIVIDUAL_CALLS[ip][url]++;
|
INDIVIDUAL_CALLS[ip][url]++;
|
||||||
if (INDIVIDUAL_CALLS[ip][url] >= conf["max"]) {
|
if (INDIVIDUAL_CALLS[ip][url] >= conf["max"]) {
|
||||||
|
res.status(429)
|
||||||
console.log(5, "ratelimiting someone on", url, INDIVIDUAL_CALLS[ip][url], conf["max"]);
|
console.log(5, "ratelimiting someone on", url, INDIVIDUAL_CALLS[ip][url], conf["max"]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user