Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHARD-887 - fix: error when batch size is above 100 #88

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' })
}
}
Loading