Skip to content

Commit

Permalink
Merge pull request xbmc#17711 from howie-f/v19-proxycredentials
Browse files Browse the repository at this point in the history
[CurlFile] proper setup proxy credentials
  • Loading branch information
phunkyfish authored and Maven85 committed Aug 5, 2020
1 parent 52196b7 commit 52b8252
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xbmc/filesystem/CurlFile.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 52b8252

Please sign in to comment.