Skip to content

fix: URL-encode tokenName query parameter - #452

Open
pcbeingused33 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c9455-tokenname-encode
Open

pcbeingused33 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c9455-tokenname-encode

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

appendUrlParams percent-encodes the free-text query parameters search, filter, croql, name and prefix (#447, #449), but tokenName is still concatenated as it is. listAiRequestLogs sends it as a filter on ai/request-logs, and token names are free text: a value such as Token name makes URI.create throw IllegalArgumentException before the request is sent, an & cuts the value short, and a + reaches the server as a space.

tokenName is now encoded with the same RequestEncoder.encodeSpaces helper. Other parameters are unchanged, so an already encoded orderBy is not encoded twice.

A new case in HttpClientTest covers a token name with a space and # next to an already encoded orderBy. It fails without the change.

AI assistance was used to prepare the patch and regression test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant