Closed
Description
Describe the bug
In last version of Spring Gateway MVC, prefixPath filter does not support Encoded url like "/url with/space"
The path is transformed to "/url%2520with/space" instead of "/url%20with/space"
The filter should use getPath instead of getRawPath
Similar to #3482
Sample
Adding this test in BeforeFilterFunctionsTests reproduce the issue
@Test
void prefixEncodedPath() {
MockHttpServletRequest servletRequest = MockMvcRequestBuilders
.get("http://localhost/get/é").buildRequest(null);
ServerRequest request = ServerRequest.create(servletRequest,
Collections.emptyList());
ServerRequest modified = BeforeFilterFunctions.prefixPath("/pre fix")
.apply(request);
assertThat(modified.uri().getRawPath()).isEqualTo("/pre%20fix/get/%C3%A9");
}