File tree 2 files changed +19
-1
lines changed
main/java/org/springframework/web/service/invoker
test/java/org/springframework/web/service/invoker
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ private String appendQueryParams(
493
493
494
494
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder .fromUriString (uriTemplate );
495
495
for (Map .Entry <String , List <String >> entry : requestParams .entrySet ()) {
496
- String nameVar = entry .getKey ();
496
+ String nameVar = entry .getKey (). replace ( ":" , "%3A" ); // suppress treatment as regex
497
497
uriVars .put (nameVar , entry .getKey ());
498
498
for (int j = 0 ; j < entry .getValue ().size (); j ++) {
499
499
String valueVar = nameVar + "[" + j + "]" ;
Original file line number Diff line number Diff line change @@ -99,6 +99,24 @@ void queryParamsWithUriTemplate() {
99
99
.isEqualTo ("/path?param1=1st%20value¶m2=2nd%20value%20A¶m2=2nd%20value%20B" );
100
100
}
101
101
102
+ @ Test // gh-34364
103
+ void queryParamWithSemicolon () {
104
+ HttpRequestValues requestValues = HttpRequestValues .builder ().setHttpMethod (HttpMethod .POST )
105
+ .setUriTemplate ("/path" )
106
+ .addRequestParameter ("userId:eq" , "test value" )
107
+ .build ();
108
+
109
+ String uriTemplate = requestValues .getUriTemplate ();
110
+ assertThat (uriTemplate ).isEqualTo ("/path?{userId%3Aeq}={userId%3Aeq[0]}" );
111
+
112
+ URI uri = UriComponentsBuilder .fromUriString (uriTemplate )
113
+ .encode ()
114
+ .build (requestValues .getUriVariables ());
115
+
116
+ assertThat (uri .toString ())
117
+ .isEqualTo ("/path?userId%3Aeq=test%20value" );
118
+ }
119
+
102
120
@ Test
103
121
void queryParamsWithPreparedUri () {
104
122
You can’t perform that action at this time.
0 commit comments