From d9d28dd707aa6249b5a288c3e8b95b57fa60014a Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 25 Aug 2019 05:05:36 +0200 Subject: [PATCH] Percent-decode proxy username and password. --- src/http.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/http.cpp b/src/http.cpp index 628ed34..71cbdc1 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -58,10 +58,14 @@ void set_proxy() if (regex_search(env_proxy, match, re_proxy)) { + string username, password; + Poco::URI::decode(match[1].str(), username); + Poco::URI::decode(match[2].str(), password); + proxyconfig.host = match[3].str(); proxyconfig.port = std::stoi(match[4].str()); - proxyconfig.username = match[1].str(); - proxyconfig.password = match[2].str(); + proxyconfig.username = username; + proxyconfig.password = password; HTTPSClientSession::setGlobalProxyConfig(proxyconfig); }