mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-29 01:38:26 +00:00
api: return 429 http status for rate-limit
This commit is contained in:
parent
192635f2ce
commit
76a15e1b1d
|
@ -67,7 +67,7 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
|
||||||
limit: env.rateLimitWindow
|
limit: env.rateLimitWindow
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return res.status(status).json(body);
|
return res.status(429).json(body);
|
||||||
};
|
};
|
||||||
|
|
||||||
const keyGenerator = (req) => hashHmac(getIP(req), 'rate').toString('base64url');
|
const keyGenerator = (req) => hashHmac(getIP(req), 'rate').toString('base64url');
|
||||||
|
|
Loading…
Reference in a new issue