Browse Source

don't override Host if not specified explicitly

pull/697/merge
orignal 8 years ago
parent
commit
c90d5bb67c
  1. 6
      I2PTunnel.cpp

6
I2PTunnel.cpp

@ -238,8 +238,8 @@ namespace client
if (line == "\r") endOfHeader = true; if (line == "\r") endOfHeader = true;
else else
{ {
if (line.find ("Host:") != std::string::npos) if (m_Host.length () > 0 && line.find ("Host:") != std::string::npos)
m_OutHeader << "Host: " << m_Host << "\r\n"; m_OutHeader << "Host: " << m_Host << "\r\n"; // override host
else else
m_OutHeader << line << "\n"; m_OutHeader << line << "\n";
} }
@ -501,7 +501,7 @@ namespace client
int port, std::shared_ptr<ClientDestination> localDestination, int port, std::shared_ptr<ClientDestination> localDestination,
const std::string& host, int inport, bool gzip): const std::string& host, int inport, bool gzip):
I2PServerTunnel (name, address, port, localDestination, inport, gzip), I2PServerTunnel (name, address, port, localDestination, inport, gzip),
m_Host (host.length () > 0 ? host : address) m_Host (host)
{ {
} }

Loading…
Cancel
Save