Skip to content

#2199 BasicURLNormalizer: split the query on & only, not on ; - #2260

Open
GitMehdi-sys wants to merge 1 commit into
apache:mainfrom
GitMehdi-sys:fix-2199-query-separator
Open

GitMehdi-sys wants to merge 1 commit into
apache:mainfrom
GitMehdi-sys:fix-2199-query-separator

Conversation

@GitMehdi-sys

Copy link
Copy Markdown

Fixes #2199

BasicURLNormalizer parsed the query with URLEncodedUtils.parse(query, UTF_8), which treats both & and ; as separators, so a ; used as ordinary data (e.g. ?q=a;b) was split into two parameters. It now passes '&' as the only separator, following the URL Standard.

Behaviour note: the query is still rebuilt with URLEncodedUtils.format(), which percent-encodes ';' like the other characters the normaliser already canonicalises, so q=a;b becomes q=a%3Bb (a single parameter that decodes to the same value) instead of being split into b&q=a. Existing tests all expect re-encoding (e.g. ! -> %21), so I kept that.

Tests: added testSemicolonIsNotAQuerySeparator, which fails without the fix. All 719 core tests pass.

@GitMehdi-sys
GitMehdi-sys force-pushed the fix-2199-query-separator branch from b5e003f to d093e2c Compare October 23, 2026 19:53

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.

URLNormalizer The query is split on ; as well as &, which rewrites URLs

1 participant