Skip to content

Commit deae205

Browse files
committed
Polishing.
(cherry picked from commit d3e8c9f)
1 parent 796a5eb commit deae205

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,8 @@ private static String encodePart(String pathPart) {
14521452
// encode each part (e.g. index, type and id) separately before merging them into the path
14531453
// we prepend "/" to the path part to make this path absolute, otherwise there can be issues with
14541454
// paths that start with `-` or contain `:`
1455-
URI uri = new URI((String)null, "", "/" + pathPart, (String)null, (String)null);
1455+
// the authority must be an empty string and not null, else paths that being with slashes could have them
1456+
URI uri = new URI((String) null, "", "/" + pathPart, (String) null, (String) null);
14561457
// manually encode any slash that each part may contain
14571458
return uri.getRawPath().substring(1).replaceAll("/", "%2F");
14581459
} catch (URISyntaxException e) {

0 commit comments

Comments
 (0)