Skip to content

fix: URL-encode search, filter and croql query parameters - #447

Merged
andrii-bodnar merged 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c6330-encode-search-params
Nov 27, 2026
Merged

andrii-bodnar merged 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c6330-encode-search-params

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

appendUrlParams concatenates query values into the URL as they are. For the free-text parameters search, filter and croql this means that a space or a double quote makes URI.create throw IllegalArgumentException before the request is sent, while & or # silently truncate the value and + is read as a space by the server.

These three parameters are now percent-encoded with the existing RequestEncoder.encodeSpaces helper, which orderBy already uses. Other parameters are unchanged, so orderBy is not encoded twice.

Note that callers who currently encode these values themselves as a workaround should now pass them unencoded.

A new case in HttpClientTest covers reserved characters in all three parameters next to an already encoded orderBy. It fails without the change; ./gradlew test passes with it (901 tests).

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

@andrii-bodnar andrii-bodnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@pcbeingused333 thank you!

@andrii-bodnar
andrii-bodnar merged commit c7e01c8 into crowdin:master Nov 27, 2026
2 checks passed
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.

2 participants