server: increase rate limit of /data endpoint to 200/5min

This commit is contained in:
Jesse Chan
2021-01-23 00:32:32 +08:00
parent 4f38447459
commit 66fdb8cb50
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;