You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect a '+' inside a query parameter value to be encoded to '%2B'. With feign 10.1, it seems the '+' is left untouched when the param is encoded.
The text was updated successfully, but these errors were encountered:
I noticed the same while migrating from 9.3.1 to 10.0.1.
In particular the suspect code is in UriUtils:
private static String urlEncode(String value, Charset charset) {
try {
String encoded = URLEncoder.encode(value, charset.toString());
/*
* url encoding is not equivalent to URI encoding, there are few differences, namely dealing
* with spaces, !, ', (, ), and ~ characters. we will need to manually process those values.
*/
return encoded.replaceAll("\\+", "%20")
.replaceAll("\\%21", "!")
.replaceAll("\\%27", "'")
.replaceAll("\\%28", "(")
.replaceAll("\\%29", ")")
.replaceAll("\\%7E", "~")
.replaceAll("\\%2B", "+");
} catch (UnsupportedEncodingException uee) {
/* since the encoding is not supported, return the original value */
return value;
}
For example the value +asd for a path parameter is first encoded to %2Basd and after restored to +asd.
I would expect a '+' inside a query parameter value to be encoded to '%2B'. With feign 10.1, it seems the '+' is left untouched when the param is encoded.
The text was updated successfully, but these errors were encountered: