From 9b1b538e1295e3d6fa426e09493d651a324cfe87 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Tue, 21 Apr 2020 07:54:09 +0100 Subject: [PATCH] Merge pull request #17711 from howie-f/v19-proxycredentials [CurlFile] proper setup proxy credentials --- xbmc/filesystem/CurlFile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp index 0fcc4c655c80a..93f3eec99c07f 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)