Skip to content

Commit e27e320

Browse files
committed
Use getPath instead of getRawPath to prevent doulbe encoding of the URI
Signed-off-by: Jens Mallien <[email protected]>
1 parent 656ab5a commit e27e320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/filter/BeforeFilterFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public static Function<ServerRequest, ServerRequest> rewritePath(String regexp,
324324
Pattern pattern = Pattern.compile(regexp);
325325
return request -> {
326326
// TODO: original request url
327-
String path = request.uri().getRawPath();
327+
String path = request.uri().getPath();
328328
String newPath = pattern.matcher(path).replaceAll(normalizedReplacement);
329329

330330
URI rewrittenUri = UriComponentsBuilder.fromUri(request.uri()).replacePath(newPath).build().toUri();

0 commit comments

Comments
 (0)