HDDS-766. Ozone shell create volume fails if volume name does not have a leading slash. Contributed by chencan.
This commit is contained in:
parent
1aad99a718
commit
96c104d365
@ -179,6 +179,12 @@ private static URI stringToUri(String pathString) {
|
||||
// but any occurrence of them will be quoted by the URI ctor.
|
||||
String path = pathString.substring(start, pathString.length());
|
||||
|
||||
// add leading slash to the path, if it does not exist
|
||||
int firstSlash = path.indexOf('/');
|
||||
if(firstSlash != 0) {
|
||||
path = "/" + path;
|
||||
}
|
||||
|
||||
if (authority == null || authority.equals("")) {
|
||||
authority = EMPTY_HOST;
|
||||
}
|
||||
|
@ -45,7 +45,8 @@ public static Collection<Object[]> data() {
|
||||
{"http://localhost:9878/"},
|
||||
{"http://localhost/"},
|
||||
{"http:///"},
|
||||
{"/"}
|
||||
{"/"},
|
||||
{""}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user