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:
parent
079fb4dd4d
commit
3eaac582d0
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user