Use getPath instead of getRawPath to prevent doulbe encoding of the URI

Signed-off-by: Jens Mallien <108389225+jensmatw@users.noreply.github.com>
This commit is contained in:
Jens Mallien
2024-07-30 13:52:17 +02:00
committed by Jens Mallien
parent 656ab5aba4
commit e27e320023

View File

@@ -324,7 +324,7 @@ public abstract class BeforeFilterFunctions {
Pattern pattern = Pattern.compile(regexp);
return request -> {
// TODO: original request url
String path = request.uri().getRawPath();
String path = request.uri().getPath();
String newPath = pattern.matcher(path).replaceAll(normalizedReplacement);
URI rewrittenUri = UriComponentsBuilder.fromUri(request.uri()).replacePath(newPath).build().toUri();