Skip to content

Commit

Permalink
fix: error when batch size is above 100
Browse files Browse the repository at this point in the history
  • Loading branch information
BelfordZ authored Nov 13, 2024
1 parent 4a121a3 commit 98ab937
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/middlewares/methodWhitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export const methodWhitelist = (req: Request, res: Response, next: NextFunction)
if (body.length === 0) {
return res.status(400).json({ error: 'Empty batch request' })
}

if (body.length > 100) { // remove in favor of jayson option when updated to [email protected]
return res.status(400).json({ error: 'Max batch size exceeded (100)' })
}

// Handle batch requests
const allMethodsAllowed = body.every(request => {
Expand All @@ -29,4 +33,4 @@ export const methodWhitelist = (req: Request, res: Response, next: NextFunction)
}

return res.status(403).json({ error: 'Forbidden' })
}
}

0 comments on commit 98ab937

Please sign in to comment.