Skip to content

Bug: HTTP mocks can't handle complex query params that include commas #809

Description

@bthdimension

Citrus Version
2.8.0, but the code causing the issue is still present in 3.0.0

Expected behavior
When calling a Citrus HTTP Server, I expect it to handle complex but correctly formated query parameters and continue to validate my headers and payloads as usual.

Actual behavior
Citrus can't handle the HTTP request and throws an error before getting to validate it. This is due to the following lines:

Splitting by commas doesn't work if the values of the query params are more complex and contain commas. Why not just split by "&"?

Test case sample
Our query params look like this:

?$top=3,$select=ComponentTypeName,%20Name%20,Description,$filter=ArchitectureName%20eq%20'Helsana%20Current%20State'%20and%20(Properties/any(p:p/Name%20eq%20'Inventar-ID'%20and%20(p/Value%20eq%20'17589'))),$expand=Properties($select=Name,%20Value;$filter=Name%20eq%20'Inventar-ID'%20or%20Name%20eq%20'App_Index'%20or%20Name%20eq%20'Status'%20or%20Name%20eq%20'Service%20Modell'%20or%20Name%20eq%20'Alias'%20or%20Name%20eq%20'Description'%20or%20Name%20eq%20'Serviceklasse'),%20inconnections($select=Name;$filter=Name%20eq%20'Service%20Owner'%20or%20Name%20eq%20'Applikationsowner'%20or%20Name%20eq%20'Benutzervertreter'%20or%20Name%20eq%20'Hersteller'%20or%20Name%20eq%20'Gesch%C3%A4ftsbereich';$expand=Properties($select=Name,Value;$filter=Name%20eq%20'Bemerkung'),SourceComponent($select=Name;$expand=Properties($select=Name,Value;$filter=Name%20eq%20'Benutzer-ID'))),$orderby=Name%20asc

The error is:

java.lang.IllegalStateException: Duplicate key Value;$filter (attempted merging values Name%20eq%20'Bemerkung') and Name%20eq%20'Benutzer-ID'))))

Metadata

Metadata

Assignees

Labels

bugSomething went wrong or does not behave as expectedenhancementgood first issueA good point to start from for new contributrsprio-high

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions