diff options
author | phunkyfish <phunkyfish@gmail.com> | 2020-04-21 07:54:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 07:54:09 +0100 |
commit | 8c7a0fe0dfad5f8b3e66ed4cd2710b9bf016570b (patch) | |
tree | 6851a1e92cae55b1096e52e09ca9da4f7dea9596 | |
parent | 89db12cef8a20a84af0b02af71459786e26beb79 (diff) | |
parent | e66def57aace34ebfb8f274b13f39fdc3aceba73 (diff) |
Merge pull request #17711 from howie-f/v19-proxycredentials
[CurlFile] proper setup proxy credentials
-rw-r--r-- | xbmc/filesystem/CurlFile.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp index 0fcc4c655c..93f3eec99c 100644 --- a/xbmc/filesystem/CurlFile.cpp +++ b/xbmc/filesystem/CurlFile.cpp @@ -601,9 +601,12 @@ void CCurlFile::SetCommonOptions(CReadState* state, bool failOnError /* = true * StringUtils::Format(":%d", m_proxyport); g_curlInterface.easy_setopt(h, CURLOPT_PROXY, hostport.c_str()); - const std::string userpass = - m_proxyuser + std::string(":") + m_proxypassword; - if (userpass != ":") + std::string userpass; + + if (!m_proxyuser.empty() && !m_proxypassword.empty()) + userpass = CURL::Encode(m_proxyuser) + ":" + CURL::Encode(m_proxypassword); + + if (!userpass.empty()) g_curlInterface.easy_setopt(h, CURLOPT_PROXYUSERPWD, userpass.c_str()); } if (m_customrequest.length() > 0) |