fix(api): robust validation and bounds clamping for limit and offset parameters #25.#56
fix(api): robust validation and bounds clamping for limit and offset parameters #25.#56Vedant4102004 wants to merge 2 commits into
Conversation
|
@Vedant4102004 is attempting to deploy a commit to the aditthyass' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @Vedant4102004 , thank you for the contribution I noticed that there are merge conflicts in this PR Please sync your branch with the latest Let me know if you need any assistance while resolving them. Thanks again for the contribution |
|
Hi @AditthyaSS ! Thank you for the update. I have synced my local branch with the latest The validation, |
|
Hey @AditthyaSS I have synced my local branch with the latest main changes, successfully resolved the merge conflicts inside src/app/api/models/route.ts, and pushed the clean logic stack. you can check it and merge it |
💡 Problem Description
The
GET /api/modelsroute was directly consuming uncoerced strings from query parameters. Passing alphanumeric payloads (undefined,abc), negative numbers, or massive thresholds caused runtime engine errors inside Prisma or unexpected application behaviors.🛠️ Proposed Solution
MAX_LIMIT = 50,DEFAULT_LIMIT = 10,DEFAULT_OFFSET = 0).isNaN()guards onparseIntexecutions to prevent malformed text vectors from passing to database utilities.0or bypass the protection ceiling.Closes #25