Fix URL decoding issue in reactive @RequestParam
%-encoded strings were injected undecoded into @RequestParam variables, which does not coincide with spring-webmvc behaviour. This commit fixes AbstractServerHttpRequest.getQueryParams() to correctly return decoded name-value pairs. Issue: SPR-15140
This commit is contained in:
committed by
Rossen Stoyanchev
parent
88c5f5981f
commit
613e65f043
@@ -64,6 +64,13 @@ public class ServerHttpRequestTests {
|
||||
assertEquals(Arrays.asList("1", "2"), params.get("a"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryParamsWithUrlEncodedValue() throws Exception {
|
||||
MultiValueMap<String, String> params = createHttpRequest("/path?a=%20%2B+%C3%A0").getQueryParams();
|
||||
assertEquals(1, params.size());
|
||||
assertEquals(Collections.singletonList(" + \u00e0"), params.get("a"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryParamsWithEmptyValue() throws Exception {
|
||||
MultiValueMap<String, String> params = createHttpRequest("/path?a=").getQueryParams();
|
||||
|
||||
Reference in New Issue
Block a user