From 6b070dec9857b2811b4dddf02d73a5f47803b4f0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 25 Aug 2019 05:08:37 +0200 Subject: [PATCH] Percent-decode proxy username and password. --- src/http.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/http.cpp b/src/http.cpp index 50bc4eb..7e006dc 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -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; } }