mirror of
https://github.com/zoriya/flood.git
synced 2026-05-30 10:08:36 +00:00
server: increase rate limit of /data endpoint to 200/5min
This commit is contained in:
@@ -36,7 +36,7 @@ router.get<{hash: string; indices: string}, unknown, unknown, {token: string}>(
|
||||
'/torrents/:hash/contents/:indices/data',
|
||||
rateLimit({
|
||||
windowMs: 5 * 60 * 1000,
|
||||
max: 60,
|
||||
max: 100,
|
||||
}),
|
||||
async (req, _res, next) => {
|
||||
const {token} = req.query;
|
||||
|
||||
@@ -705,10 +705,10 @@ router.get<{hash: string; indices: string}, unknown, unknown, {token: string}>(
|
||||
router.get<{hash: string; indices: string}, unknown, unknown, {token: string}>(
|
||||
'/:hash/contents/:indices/data',
|
||||
// This operation is resource-intensive
|
||||
// Limit each IP to 60 requests every 5 minutes
|
||||
// Limit each IP to 200 requests every 5 minutes
|
||||
rateLimit({
|
||||
windowMs: 5 * 60 * 1000,
|
||||
max: 60,
|
||||
max: 200,
|
||||
}),
|
||||
(req, res) => {
|
||||
const {hash, indices: stringIndices} = req.params;
|
||||
|
||||
Reference in New Issue
Block a user