Follow up #2150: Special chars in values of query strings
Follow up #2150
- #2150
Special chars in values of query strings
A 3rd additional test case:
- [InlineData("api/debug()")] // no query
- [InlineData("api/debug%28%29")] // encoded debug()
+ [InlineData("api/debug()?special=(\\,*,+,?,|,{,},[,],(,),^,$,.,#, ,)&2=(2)&3=[3]&4={4}")] // with queryThe third test has revealed issues within the middleware logic, indicating that this test case is likely to fail. The MergeQueryStringsWithoutDuplicateValues method struggles to handle URLs containing query strings with special characters, such as Regex patterns and reserved URL specification characters. This issue became apparent in release 20.0.0 during the refactoring of the MergeQueryStringsWithoutDuplicateValues method, which aimed to integrate existing and new logic (for example OData filters in query parameters, with bug fixes, with new feature for query string placeholders). Regrettably, the method fails to process special characters in parameter values.
Originally posted by @raman-m in https://github.com/ThreeMammals/Ocelot/pull/2150#discussion_r1767004179
Subject
Source: ThreeMammals/Ocelot