|
|
@ -282,7 +282,6 @@ namespace proxy { |
|
|
|
bool useConnect = false; |
|
|
|
bool useConnect = false; |
|
|
|
if(m_ClientRequest.method == "CONNECT") |
|
|
|
if(m_ClientRequest.method == "CONNECT") |
|
|
|
{ |
|
|
|
{ |
|
|
|
SanitizeHTTPRequest (m_ClientRequest); |
|
|
|
|
|
|
|
std::string uri(m_ClientRequest.uri); |
|
|
|
std::string uri(m_ClientRequest.uri); |
|
|
|
auto pos = uri.find(":"); |
|
|
|
auto pos = uri.find(":"); |
|
|
|
if(pos == std::string::npos || pos == uri.size() - 1) |
|
|
|
if(pos == std::string::npos || pos == uri.size() - 1) |
|
|
@ -392,7 +391,9 @@ namespace proxy { |
|
|
|
|
|
|
|
|
|
|
|
if (m_ProxyURL.schema == "http" && (!m_ProxyURL.user.empty () || !m_ProxyURL.pass.empty ())) |
|
|
|
if (m_ProxyURL.schema == "http" && (!m_ProxyURL.user.empty () || !m_ProxyURL.pass.empty ())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// http proxy authorization
|
|
|
|
// remove existing authorization if any
|
|
|
|
|
|
|
|
m_ClientRequest.RemoveHeader("Proxy-"); |
|
|
|
|
|
|
|
// add own http proxy authorization
|
|
|
|
std::string s = "Basic " + i2p::data::ToBase64Standard (m_ProxyURL.user + ":" + m_ProxyURL.pass); |
|
|
|
std::string s = "Basic " + i2p::data::ToBase64Standard (m_ProxyURL.user + ":" + m_ProxyURL.pass); |
|
|
|
m_ClientRequest.AddHeader("Proxy-Authorization", s); |
|
|
|
m_ClientRequest.AddHeader("Proxy-Authorization", s); |
|
|
|
} |
|
|
|
} |
|
|
|