Fix trailing slash in nested path
This commit adds a trailing slash to the nested path if the request path also ends with a slash. For instance, given the request "/foo/bar/", and nested path pattern "/foo/**", we expect the nested path to be “/bar/”, not “/bar".
This commit is contained in:
parent
babd5517aa
commit
7582adc0bc
|
|
@ -386,6 +386,9 @@ public abstract class RequestPredicates {
|
|||
if (!subPath.startsWith("/")) {
|
||||
subPath = "/" + subPath;
|
||||
}
|
||||
if (requestPath.endsWith("/") && !subPath.endsWith("/")) {
|
||||
subPath += "/";
|
||||
}
|
||||
return new SubPathServerRequestWrapper(request, subPath);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue