Skip to content

Commit d88fb03

Browse files
authored
Fix uri encode bug when url path start with '/'.
Original Pull Request #1873 Closes #1870
1 parent 7c35756 commit d88fb03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ 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(null, null, null, -1, '/' + pathPart, null, null);
1438+
URI uri = new URI((String)null, "", "/" + pathPart, (String)null, (String)null);
14391439
// manually encode any slash that each part may contain
14401440
return uri.getRawPath().substring(1).replaceAll("/", "%2F");
14411441
} catch (URISyntaxException e) {

0 commit comments

Comments
 (0)