Giving informative error messages for double slashes in API call URLs (#1568)
* Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com> Changes related to Informative error messages. * Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com> Spotless changes * Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com> naming and message changes. Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com> * Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com> Deleting the log message.
This commit is contained in:
parent
0c21689202
commit
12a229410c
|
@ -250,6 +250,9 @@ public class MetadataCreateIndexService {
|
|||
if (!Strings.validFileName(index)) {
|
||||
throw exceptionCtor.apply(index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS);
|
||||
}
|
||||
if (index.isEmpty()) {
|
||||
throw exceptionCtor.apply(index, "must not be empty");
|
||||
}
|
||||
if (index.contains("#")) {
|
||||
throw exceptionCtor.apply(index, "must not contain '#'");
|
||||
}
|
||||
|
|
|
@ -626,6 +626,8 @@ public class MetadataCreateIndexServiceTests extends OpenSearchTestCase {
|
|||
validateIndexName(checkerService, "..", "must not be '.' or '..'");
|
||||
|
||||
validateIndexName(checkerService, "foo:bar", "must not contain ':'");
|
||||
|
||||
validateIndexName(checkerService, "", "Invalid index name [], must not be empty");
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue