|
|
@ -328,7 +328,7 @@ namespace client |
|
|
|
if (line == "\r") endOfHeader = true; |
|
|
|
if (line == "\r") endOfHeader = true; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (m_Host.length () > 0 && line.find ("Host:") != std::string::npos) |
|
|
|
if (m_Host.length () > 0 && !line.compare(0, 5, "Host:")) |
|
|
|
m_OutHeader << "Host: " << m_Host << "\r\n"; // override host
|
|
|
|
m_OutHeader << "Host: " << m_Host << "\r\n"; // override host
|
|
|
|
else |
|
|
|
else |
|
|
|
m_OutHeader << line << "\n"; |
|
|
|
m_OutHeader << line << "\n"; |
|
|
@ -377,15 +377,19 @@ namespace client |
|
|
|
if (line == "\r") endOfHeader = true; |
|
|
|
if (line == "\r") endOfHeader = true; |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (line.find ("Server:") != std::string::npos) continue; // exclude "Server:"
|
|
|
|
static const std::vector<std::string> excluded // list of excluded headers
|
|
|
|
if (line.find ("Date:") != std::string::npos) continue; // exclude "Date""
|
|
|
|
{ |
|
|
|
if (line[0] == 'X') |
|
|
|
"Server:", "Date:", "X-Runtime:", "X-Powered-By:", "Proxy" |
|
|
|
{ |
|
|
|
}; |
|
|
|
if (line.find ("X-Runtime:") != std::string::npos) continue; // exclude "X-Runtime:"
|
|
|
|
bool matched = false; |
|
|
|
if (line.find ("X-Powered-By:") != std::string::npos) continue; // exclude "X-Powered-By:"
|
|
|
|
for (const auto& it: excluded) |
|
|
|
} |
|
|
|
if (!line.compare(0, it.length (), it)) |
|
|
|
|
|
|
|
{ |
|
|
|
m_OutHeader << line << "\n"; |
|
|
|
matched = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!matched) |
|
|
|
|
|
|
|
m_OutHeader << line << "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|