Skip to content

Commit

Permalink
replace Proxy-Authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Apr 13, 2018
1 parent 387e030 commit a9b6489
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libi2pd_client/HTTPProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ namespace proxy {
bool useConnect = false;
if(m_ClientRequest.method == "CONNECT")
{
SanitizeHTTPRequest (m_ClientRequest);
std::string uri(m_ClientRequest.uri);
auto pos = uri.find(":");
if(pos == std::string::npos || pos == uri.size() - 1)
Expand Down Expand Up @@ -392,7 +391,9 @@ namespace proxy {

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);
m_ClientRequest.AddHeader("Proxy-Authorization", s);
}
Expand Down

0 comments on commit a9b6489

Please sign in to comment.