Skip to content

Commit

Permalink
Giving informative error messages for double slashes in API call URLs…
Browse files Browse the repository at this point in the history
…- [ BACKPORT-1.x ] (opensearch-project#1601)

* Integration test that checks for settings upgrade  (opensearch-project#1482)

* Made changes.

Signed-off-by: Megha Sai Kavikondala <[email protected]>

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

Changes made by deleting the TestSettingsIT file and adding new lines in FullClusterRestartSettingsUpgradeIT.java

Signed-off-by: Megha Sai Kavikondala <[email protected]>

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

Informative error messages related to empty index name.[Backport]
  • Loading branch information
meghasaik authored Nov 23, 2021
1 parent dc14994 commit 83e005b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ public static void validateIndexOrAliasName(String index, BiFunction<String, Str
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 '#'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ public void testValidateIndexName() throws Exception {
validateIndexName(checkerService, "..", "must not be '.' or '..'");

validateIndexName(checkerService, "foo:bar", "must not contain ':'");

validateIndexName(checkerService, "", "Invalid index name [], must not be empty");
}));
}

Expand Down

0 comments on commit 83e005b

Please sign in to comment.