From 1012a768b12e75f71548e8b4b26f518d62a03eca Mon Sep 17 00:00:00 2001 From: Vladimir Chebotarev Date: Thu, 3 Jun 2021 09:09:09 +0300 Subject: [PATCH] Allowed S3 key to be empty. --- src/IO/S3Common.cpp | 5 ----- 1 file changed, 5 deletions(-) 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);