Description
Follow up #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 query
The 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 #2150 (comment)
Subject
-
Unit tests
-
Acceptance tests
Ocelot/test/Ocelot.AcceptanceTests/Routing/RoutingTests.cs
Lines 1171 to 1175 in d310508
Metadata
Metadata
Assignees
Type
Projects
Status