Skip to content

Validate search query input#4193

Open
bozicovichsantiago20-oss wants to merge 1 commit into
SecureBananaLabs:mainfrom
bozicovichsantiago20-oss:codex/validate-search-query
Open

Validate search query input#4193
bozicovichsantiago20-oss wants to merge 1 commit into
SecureBananaLabs:mainfrom
bozicovichsantiago20-oss:codex/validate-search-query

Conversation

@bozicovichsantiago20-oss

Copy link
Copy Markdown

Summary

  • Add a search query validator for GET /api/search.
  • Default missing q to an empty string, trim valid string input, and cap q at 200 characters.
  • Reject non-string query input such as repeated q parameters with a structured 400 response.
  • Add focused API tests and update the package test script to run test files.

Verification

  • npm.cmd test -w apps/api
  • node --test apps/api/src/tests/search.test.js
  • git diff --check

Closes #4191
Refs #743
/claim #4191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search endpoint should validate and length-limit q

1 participant