Skip to content

fix(validations): coerce duplicate query parameter arrays into single values#6121

Open
MasterJi27 wants to merge 2 commits into
JhaSourav07:mainfrom
MasterJi27:fix/duplicate-query-coercion-5267
Open

fix(validations): coerce duplicate query parameter arrays into single values#6121
MasterJi27 wants to merge 2 commits into
JhaSourav07:mainfrom
MasterJi27:fix/duplicate-query-coercion-5267

Conversation

@MasterJi27

Copy link
Copy Markdown
Contributor

Fixes #5267

… values

Closes JhaSourav07#5267

- Add coerceQueryParams() to extract the first value of duplicate keys
- Apply coerceQueryParams() before Zod validation in all GET endpoints
- Add unit tests for duplicate parameter coercion
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@MasterJi27 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3710.63 KB 3710.63 KB 0 B
Total CSS 290.64 KB 290.64 KB 0 B

@Aamod-Dev Aamod-Dev added GSSoC 2026 mentor:Aamod007 level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. bug Something isn't working refactor labels Jun 21, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling duplicate query parameters securely is a classic edge case. Coercing query parameters using coerceQueryParams in app/api/compare/route.ts and others before passing them to the Zod schema ensures we don't hit unexpected validation failures when parameters are passed multiple times. Approved!

@github-actions github-actions Bot added the type:bug Something isn't working as expected label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gssoc:needs-rebase GSSoC 2026 level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. refactor type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Coerce duplicate query parameter arrays into single values

3 participants