0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00

HTTPProxyTransport: Simplify parsing of http-proxy-user-pass

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2023-10-23 18:59:09 +02:00 committed by David Sommerseth
parent 079fb4dd4d
commit 3eaac582d0
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2

View File

@ -132,16 +132,7 @@ class Options : public RC<thread_safe_refcount>
set_proxy_server(hp->get(1, 256), hp->get(2, 16));
// get creds
{
std::vector<std::string> user_pass;
if (UserPass::parse(opt, "http-proxy-user-pass", 0, &user_pass))
{
if (user_pass.size() >= 1)
username = user_pass[0];
if (user_pass.size() >= 2)
password = user_pass[1];
}
}
UserPass::parse(opt, "http-proxy-user-pass", UserPass::OPT_OPTIONAL, username, password);
const std::string auth = hp->get_optional(3, 16);
if (!auth.empty())