Skip to content

Commit

Permalink
feat : add negativity check on record request count
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulazeem-tk4vr committed Jan 14, 2025
1 parent 4a44dbc commit 2d4d852
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,10 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
reply.send({ success: false, error: result.error })
return
}
if (payload.maxRecords > config.maxRecordsPerRequest) {
if (payload.maxRecords > config.maxRecordsPerRequest || payload.maxRecords < 0) {
reply.send({
success: false,
error: `AccountBucket size has exceeded the max records allowed per request. Allowed: ${config.maxRecordsPerRequest}`,
error: `Invalid AccountBucket size. Must be between 0 and ${config.maxRecordsPerRequest}.`,
})
return
}
Expand Down

0 comments on commit 2d4d852

Please sign in to comment.