From 27dd0b7405cad58cb10ccdfb1f6195836535e6de Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 Jun 2012 20:56:30 +0900 Subject: [PATCH] Don't forward keep-alive, connection and proxy-connection header fields --- examples/shrpx_downstream.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/shrpx_downstream.cc b/examples/shrpx_downstream.cc index 0d5517cb..89496d66 100644 --- a/examples/shrpx_downstream.cc +++ b/examples/shrpx_downstream.cc @@ -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;