From fe501d4dd4b021ba91573859eeab1e4990e35079 Mon Sep 17 00:00:00 2001 From: michael1589 Date: Thu, 25 Nov 2021 23:03:01 +0800 Subject: [PATCH] fix merge error --- src/Storages/StorageURL.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Storages/StorageURL.cpp b/src/Storages/StorageURL.cpp index df4893cb3e1..1b378237fb3 100644 --- a/src/Storages/StorageURL.cpp +++ b/src/Storages/StorageURL.cpp @@ -21,13 +21,11 @@ #include #include -#include #include #include #include #include #include -#include namespace DB @@ -132,12 +130,15 @@ namespace { std::ostringstream ostr; std::string userInfo = request_uri.getUserInfo(); - if ("" != userInfo) + if (!userInfo.empty()) { - Poco::Base64Encoder encoder(ostr); - encoder.rdbuf()->setLineLength(0); - encoder << userInfo; - encoder.close(); + std::string::size_type n; + n = userInfo.find(":"); + if(n != std::string::npos) + { + credentials.setUsername(userInfo.substr(0, n)); + credentials.setPassword(userInfo.substr(n+1)); + } } read_buf = wrapReadBufferWithCompressionMethod( @@ -148,7 +149,6 @@ namespace timeouts, credentials, context->getSettingsRef().max_http_get_redirects, - userInfo.length() == 0 ? Poco::Net::HTTPBasicCredentials{} : Poco::Net::HTTPBasicCredentials(ostr.str()), DBMS_DEFAULT_BUFFER_SIZE, context->getReadSettings(), headers,