URI with empty path, but non-empty query part is not properly normalized. The query part is in fact duplicated. E.g, URI "foobar://?foo=1&bar=2" is incorrectly normalized to "foobar://?foo=1&bar=2?bar=2&foo=1".
This is caused by incorrect identification of the path part in org.apache.camel.util.URISupport.normalizeUri(String):
int idx = path.indexOf('?');
if (idx > 0)
The comparison of "idx > 0" is incorrect, because this way, if '?' is the first character, the path is not set to empty string. The correct comparison should be "idx > -1" or "idx >= 0" or even just "idx != -1" since that's the only value that String.indexOf returns when the character is not found.
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Fix Version/s||2.7.5 [ 12318648 ]|
|Fix Version/s||2.8.4 [ 12319072 ]|
|Fix Version/s||2.10 [ 12317612 ]|
|Resolution||Fixed [ 1 ]|
|Field||Original Value||New Value|
|Assignee||Willem Jiang [ njiang ]|