mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
test_for_basic_auth_registry - cpp code small improvement
This commit is contained in:
parent
83569688cb
commit
c1c5ffa309
@ -940,24 +940,19 @@ private:
|
||||
{
|
||||
Poco::Net::HTTPCredentials http_credentials;
|
||||
Poco::Net::HTTPBasicCredentials http_basic_credentials;
|
||||
std::string decoded_username;
|
||||
std::string decoded_password;
|
||||
|
||||
http_credentials.fromUserInfo(url.getUserInfo());
|
||||
|
||||
std::string decoded_username;
|
||||
Poco::URI::decode(http_credentials.getUsername(), decoded_username);
|
||||
http_basic_credentials.setUsername(decoded_username);
|
||||
|
||||
if (!http_credentials.getPassword().empty())
|
||||
{
|
||||
Poco::URI::decode(http_credentials.getUsername(), decoded_username);
|
||||
std::string decoded_password;
|
||||
Poco::URI::decode(http_credentials.getPassword(), decoded_password);
|
||||
|
||||
http_basic_credentials.setUsername(decoded_username);
|
||||
http_basic_credentials.setPassword(decoded_password);
|
||||
}
|
||||
else
|
||||
{
|
||||
Poco::URI::decode(http_credentials.getUsername(), decoded_username);
|
||||
http_basic_credentials.setUsername(decoded_username);
|
||||
}
|
||||
|
||||
http_basic_credentials.authenticate(request);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user