Skip to content

fix: correct route query parsing for multiple params#692

Merged
43081j merged 2 commits intonpmx-dev:mainfrom
alexdln:fix/server-error-multiple-sp
Feb 1, 2026
Merged

fix: correct route query parsing for multiple params#692
43081j merged 2 commits intonpmx-dev:mainfrom
alexdln:fix/server-error-multiple-sp

Conversation

@alexdln
Copy link
Copy Markdown
Member

@alexdln alexdln commented Feb 1, 2026

In many places, there was a force override of types on route.query, and then it worked as if it was a string. But if you pass multiple queries, it would be an array. The result was a 500 error (no trim or no toLowerCase).

I added a common method and use it everywhere. The method returns the value, either the first element of the array, or an empty string

Closes #688

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 1, 2026 11:22pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 1, 2026 11:22pm
npmx-lunaria Ignored Ignored Feb 1, 2026 11:22pm

Request Review

Copy link
Copy Markdown
Contributor

@43081j 43081j left a comment

Choose a reason for hiding this comment

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

good catch!

the types would've caught this and we casted it away 😅

@43081j 43081j added this pull request to the merge queue Feb 1, 2026
Merged via the queue into npmx-dev:main with commit 3bb9c8a Feb 1, 2026
13 checks passed
@alexdln alexdln deleted the fix/server-error-multiple-sp branch February 1, 2026 23:47
taskylizard pushed a commit to taskylizard/npmx.dev that referenced this pull request Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server error with multiple search params

2 participants