Skip to content

Commit d3e8c9f

Browse files
committed
Polishing.
1 parent d88fb03 commit d3e8c9f

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
@@ -1435,7 +1435,8 @@ private static String encodePart(String pathPart) {
14351435
// encode each part (e.g. index, type and id) separately before merging them into the path
14361436
// we prepend "/" to the path part to make this path absolute, otherwise there can be issues with
14371437
// paths that start with `-` or contain `:`
1438-
URI uri = new URI((String)null, "", "/" + pathPart, (String)null, (String)null);
1438+
// the authority must be an empty string and not null, else paths that being with slashes could have them
1439+
URI uri = new URI((String) null, "", "/" + pathPart, (String) null, (String) null);
14391440
// manually encode any slash that each part may contain
14401441
return uri.getRawPath().substring(1).replaceAll("/", "%2F");
14411442
} catch (URISyntaxException e) {

0 commit comments

Comments
 (0)