Skip to content

fix: handle literal % in Readme descriptions during deserialization#2593

Open
kabhishek1001 wants to merge 1 commit into
mainfrom
fix/decode-content-illegal-percent
Open

fix: handle literal % in Readme descriptions during deserialization#2593
kabhishek1001 wants to merge 1 commit into
mainfrom
fix/decode-content-illegal-percent

Conversation

@kabhishek1001

@kabhishek1001 kabhishek1001 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

What

URLDecoder.decode() throws IllegalArgumentException when it encounters a % not followed by exactly two valid hex digits. AssetDeserializer calls StringUtils.decodeContent() on the description of every Readme asset during index search response deserialization. If any Readme in the result batch has plain text like "50% faster" in its description, the exception propagates through Jackson and crashes deserialization of the entire batch — not just the offending asset.

Fix

Catch IllegalArgumentException in decodeContent() and return the original string. Legitimately URL-encoded descriptions (the normal case) continue to decode correctly. Plain-text descriptions that happen to contain % are returned as-is, which is the right behavior, as they were never URL-encoded in the first place.

Testing

Added decodeContentWithLiteralPercent() to StringUtilsTest covering the two patterns seen in production (%; and % u) plus the null case. Existing encodeDecodeContent() test confirms the happy path is unaffected.

URLDecoder.decode() throws IllegalArgumentException when a string
contains % not followed by two valid hex digits. Readme descriptions
stored as plain text (e.g. "50% faster") hit this when the
AssetDeserializer calls decodeContent() during an index search response.

Fall back to returning the original string when decoding fails, so
a malformed or plain-text description doesn't crash deserialization
of the entire batch.
@kabhishek1001 kabhishek1001 requested a review from cmgrote as a code owner June 29, 2026 06:01
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