From bb12f7deccd90791e39dfee9cd02ba1ff14459ea Mon Sep 17 00:00:00 2001 From: xuelei Date: Sun, 27 Aug 2023 23:41:23 -0300 Subject: [PATCH] deal with conflict --- src/Disks/ObjectStorages/S3/registerDiskS3.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Disks/ObjectStorages/S3/registerDiskS3.cpp b/src/Disks/ObjectStorages/S3/registerDiskS3.cpp index d1264affaea..3f33b5c533a 100644 --- a/src/Disks/ObjectStorages/S3/registerDiskS3.cpp +++ b/src/Disks/ObjectStorages/S3/registerDiskS3.cpp @@ -104,13 +104,9 @@ void registerDiskS3(DiskFactory & factory, bool global_skip_access_check) { String endpoint = context->getMacros()->expand(config.getString(config_prefix + ".endpoint")); S3::URI uri(endpoint); - - if (uri.key.empty()) - throw Exception(ErrorCodes::BAD_ARGUMENTS, "No key in S3 uri: {}", uri.uri.toString()); - - if (uri.key.back() != '/') - throw Exception(ErrorCodes::BAD_ARGUMENTS, "S3 path must ends with '/', but '{}' doesn't.", uri.key); - + if(!uri.key.ends_with('/')) + uri.key.push_back('/'); + S3Capabilities s3_capabilities = getCapabilitiesFromConfig(config, config_prefix); std::shared_ptr s3_storage;