#582 - LinkBuilder now makes sure appended path is considered path segment.

We now prepend the given path (and query) handed to LinkBuilderSupport.slash(…) to make sure calls to UriComponentsBuilder.fromUriString(…) always considers the given value as path. Previously, a value containing a colon caused problems as the regex to detect scheme and port would accidentally match.

Related ticket: https://jira.spring.io/browse/DATAREST-1074
This commit is contained in:
Oliver Gierke
2017-05-16 13:02:14 +02:00
parent 1d1f1cffda
commit d68700231e
3 changed files with 16 additions and 1 deletions

View File

@@ -86,6 +86,8 @@ public abstract class LinkBuilderSupport<T extends LinkBuilder> implements LinkB
return getThis();
}
path = path.startsWith("/") ? path : "/".concat(path);
return slash(UriComponentsBuilder.fromUriString(path).build(), false);
}