mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Consistently support no value params in query string
Closes gh-35329
This commit is contained in:
+6
-4
@@ -911,10 +911,12 @@ public abstract class AbstractMockHttpServletRequestBuilder<B extends AbstractMo
|
||||
}
|
||||
|
||||
private void addRequestParams(MockHttpServletRequest request, MultiValueMap<String, String> map) {
|
||||
map.forEach((key, values) -> values.forEach(value -> {
|
||||
value = (value != null ? UriUtils.decode(value, StandardCharsets.UTF_8) : null);
|
||||
request.addParameter(UriUtils.decode(key, StandardCharsets.UTF_8), value);
|
||||
}));
|
||||
map.forEach((key, values) ->
|
||||
request.addParameter(
|
||||
UriUtils.decode(key, StandardCharsets.UTF_8),
|
||||
values.stream()
|
||||
.map(value -> value != null ? UriUtils.decode(value, StandardCharsets.UTF_8) : null)
|
||||
.toArray(String[]::new)));
|
||||
}
|
||||
|
||||
private byte[] writeFormData(MediaType mediaType, Charset charset) {
|
||||
|
||||
Reference in New Issue
Block a user