Don't forward keep-alive, connection and proxy-connection header fields

This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-15 20:56:30 +09:00
parent 9d84db230d
commit 27dd0b7405

View File

@ -270,16 +270,17 @@ int Downstream::push_request_headers()
std::string via_value;
for(Headers::const_iterator i = request_headers_.begin();
i != request_headers_.end(); ++i) {
if(util::strieq((*i).first.c_str(), "X-Forwarded-Proto")) {
if(util::strieq((*i).first.c_str(), "X-Forwarded-Proto") ||
util::strieq((*i).first.c_str(), "host") ||
util::strieq((*i).first.c_str(), "keep-alive") ||
util::strieq((*i).first.c_str(), "connection") ||
util::strieq((*i).first.c_str(), "proxy-connection")) {
continue;
}
if(util::strieq((*i).first.c_str(), "via")) {
via_value = (*i).second;
continue;
}
if(util::strieq((*i).first.c_str(), "host")) {
continue;
}
if(util::strieq((*i).first.c_str(), "expect") &&
util::strifind((*i).second.c_str(), "100-continue")) {
continue;