diff --git a/src/IO/S3Common.cpp b/src/IO/S3Common.cpp index ff9eafc9bc7..2a0d70dfeaa 100644 --- a/src/IO/S3Common.cpp +++ b/src/IO/S3Common.cpp @@ -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);