Consistent support for Charset/StandardCharsets in UriUtils etc
Issue: SPR-15613
This commit is contained in:
@@ -19,7 +19,6 @@ package org.springframework.test.web.servlet.request;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Principal;
|
||||
@@ -698,17 +697,12 @@ public class MockHttpServletRequestBuilder
|
||||
}
|
||||
|
||||
private void addRequestParams(MockHttpServletRequest request, MultiValueMap<String, String> map) {
|
||||
try {
|
||||
for (Entry<String, List<String>> entry : map.entrySet()) {
|
||||
for (String value : entry.getValue()) {
|
||||
value = (value != null) ? UriUtils.decode(value, "UTF-8") : null;
|
||||
request.addParameter(UriUtils.decode(entry.getKey(), "UTF-8"), value);
|
||||
}
|
||||
for (Entry<String, List<String>> entry : map.entrySet()) {
|
||||
for (String value : entry.getValue()) {
|
||||
value = (value != null ? UriUtils.decode(value, StandardCharsets.UTF_8) : null);
|
||||
request.addParameter(UriUtils.decode(entry.getKey(), StandardCharsets.UTF_8), value);
|
||||
}
|
||||
}
|
||||
catch (UnsupportedEncodingException ex) {
|
||||
// shouldn't happen
|
||||
}
|
||||
}
|
||||
|
||||
private MultiValueMap<String, String> parseFormData(final MediaType mediaType) {
|
||||
|
||||
Reference in New Issue
Block a user