Merge branch '6.2.x'
This commit is contained in:
@@ -350,17 +350,22 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
|
||||
|
||||
String[] pairs = StringUtils.tokenizeToStringArray(body, "&");
|
||||
MultiValueMap<String, String> result = new LinkedMultiValueMap<>(pairs.length);
|
||||
for (String pair : pairs) {
|
||||
int idx = pair.indexOf('=');
|
||||
if (idx == -1) {
|
||||
result.add(URLDecoder.decode(pair, charset), null);
|
||||
}
|
||||
else {
|
||||
String name = URLDecoder.decode(pair.substring(0, idx), charset);
|
||||
String value = URLDecoder.decode(pair.substring(idx + 1), charset);
|
||||
result.add(name, value);
|
||||
try {
|
||||
for (String pair : pairs) {
|
||||
int idx = pair.indexOf('=');
|
||||
if (idx == -1) {
|
||||
result.add(URLDecoder.decode(pair, charset), null);
|
||||
}
|
||||
else {
|
||||
String name = URLDecoder.decode(pair.substring(0, idx), charset);
|
||||
String value = URLDecoder.decode(pair.substring(idx + 1), charset);
|
||||
result.add(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
throw new HttpMessageNotReadableException("Could not decode HTTP form payload", ex, inputMessage);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user