Skip to content

Conversation

@Shreyas2004wagh
Copy link

Fix URL encoding in chat.search query params

Acceptance Criteria fulfillment

  • Updated getSearchMessages to encode query parameters using URLSearchParams.
  • Ensured user input in searchText is safely encoded (&, ?, #, %, +, spaces).
  • Confirmed API package builds successfully after the change.

Fixes #1149

PR Test Details

  • Ran: yarn workspace @embeddedchat/api build (passed).
  • Verified generated request URL encodes reserved characters correctly in searchText.
  • Confirmed no functional change for normal search inputs.

Copilot AI review requested due to automatic review settings February 10, 2026 17:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes improper URL construction in the API wrapper by ensuring user-provided searchText is correctly URL-encoded when calling chat.search, preventing reserved characters from corrupting query parsing.

Changes:

  • Updated getSearchMessages to build query parameters via URLSearchParams.
  • Removed direct string interpolation of searchText into the request URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Search API does not URL-encode searchText query parameter

1 participant