Allowed S3 key to be empty.

This commit is contained in:
Vladimir Chebotarev 2021-06-03 09:09:09 +03:00 committed by GitHub
parent 2b0cd9cc29
commit 1012a768b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -639,8 +639,6 @@ namespace S3
key = uri.getPath().substr(1);
}
if (key.empty() || key == "/")
throw Exception("Key name is empty in virtual hosted style S3 URI: " + key + " (" + uri.toString() + ")", ErrorCodes::BAD_ARGUMENTS);
boost::to_upper(name);
if (name != S3 && name != COS)
{
@ -665,9 +663,6 @@ namespace S3
if (bucket.length() < 3 || bucket.length() > 63)
throw Exception(
"Bucket name length is out of bounds in path style S3 URI: " + bucket + " (" + uri.toString() + ")", ErrorCodes::BAD_ARGUMENTS);
if (key.empty() || key == "/")
throw Exception("Key name is empty in path style S3 URI: " + key + " (" + uri.toString() + ")", ErrorCodes::BAD_ARGUMENTS);
}
else
throw Exception("Bucket or key name are invalid in S3 URI: " + uri.toString(), ErrorCodes::BAD_ARGUMENTS);