Added bucket name param to ToJSONError call (#9961)

when called with InvalidBucketName error.
The user is shown a more specific error
when the param is present.
This commit is contained in:
Benjamin Sodenkamp
2020-07-10 12:10:39 -07:00
committed by GitHub
parent 968342c732
commit c00d410e61
2 changed files with 23 additions and 13 deletions

View File

@@ -329,13 +329,23 @@ func testDeleteBucketWebHandler(obj ObjectLayer, instanceType string, t TestErrH
// Empty string = no error
expect string
}{
{"", false, token, "The specified bucket is not valid"},
{"", false, token, "Bucket Name is invalid. Lowercase letters, period, " +
"hyphen, numerals are the only allowed characters and should be minimum " +
"3 characters in length."},
{".", false, "auth", "Authentication failed"},
{".", false, token, "The specified bucket is not valid"},
{"..", false, token, "The specified bucket is not valid"},
{"ab", false, token, "The specified bucket is not valid"},
{".", false, token, "Bucket Name . is invalid. Lowercase letters, period, " +
"hyphen, numerals are the only allowed characters and should be minimum " +
"3 characters in length."},
{"..", false, token, "Bucket Name .. is invalid. Lowercase letters, period, " +
"hyphen, numerals are the only allowed characters and should be minimum " +
"3 characters in length."},
{"ab", false, token, "Bucket Name ab is invalid. Lowercase letters, period, " +
"hyphen, numerals are the only allowed characters and should be minimum " +
"3 characters in length."},
{"minio", false, "false token", "Authentication failed"},
{"minio", false, token, "The specified bucket is not valid"},
{"minio", false, token, "Bucket Name minio is invalid. Lowercase letters, period, " +
"hyphen, numerals are the only allowed characters and should be minimum " +
"3 characters in length."},
{bucketName, false, token, ""},
{bucketName, true, token, "The bucket you tried to delete is not empty"},
{bucketName, false, "", "JWT token missing"},