Percent-decode proxy username and password.

This commit is contained in:
tastytea 2019-08-25 05:08:37 +02:00
parent d2a4d835de
commit 6b070dec98
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 2 deletions

View File

@ -112,11 +112,17 @@ void API::http::set_proxy(const string &hostport, const string &userpw)
if (!userpw.empty())
{
string username;
pos = userpw.find(':');
proxyconfig.username = userpw.substr(0, pos);
Poco::URI::decode(userpw.substr(0, pos), username);
proxyconfig.username = username;
if (pos != string::npos)
{
proxyconfig.password = userpw.substr(pos + 1);
string password;
Poco::URI::decode(userpw.substr(pos + 1), password);
proxyconfig.password = password;
}
}