Commit 33743ab8 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Remove banned header fields in HTTP2 request and response

parent 4744e900
......@@ -915,10 +915,13 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream)
nv[hdidx++] = response_status.c_str();
for(Headers::const_iterator i = downstream->get_response_headers().begin();
i != downstream->get_response_headers().end(); ++i) {
if(util::strieq((*i).first.c_str(), "transfer-encoding") ||
util::strieq((*i).first.c_str(), "keep-alive") || // HTTP/1.0?
util::strieq((*i).first.c_str(), "connection") ||
util:: strieq((*i).first.c_str(), "proxy-connection")) {
if(util::strieq((*i).first.c_str(), "connection") ||
util::strieq((*i).first.c_str(), "host") ||
util::strieq((*i).first.c_str(), "keep-alive") ||
util::strieq((*i).first.c_str(), "proxy-connection") ||
util::strieq((*i).first.c_str(), "te") ||
util::strieq((*i).first.c_str(), "transfer-encoding") ||
util::strieq((*i).first.c_str(), "upgrade")) {
// These are ignored
} else if(!get_config()->no_via &&
util::strieq((*i).first.c_str(), "via")) {
......
......@@ -290,16 +290,12 @@ int SpdyDownstreamConnection::push_request_headers()
}
// Ignore transfer-encoding
continue;
} else if(util::strieq((*i).first.c_str(), "upgrade")) {
// nghttpx handles HTTP/2.0 upgrade and does not relay it to the
// downstream.
if(util::strieq((*i).second.c_str(), NGHTTP2_PROTO_VERSION_ID)) {
continue;
}
} else if(util::strieq((*i).first.c_str(), "x-forwarded-proto") ||
util::strieq((*i).first.c_str(), "keep-alive") ||
util::strieq((*i).first.c_str(), "connection") ||
util::strieq((*i).first.c_str(), "proxy-connection") ||
util::strieq((*i).first.c_str(), "te") ||
util::strieq((*i).first.c_str(), "upgrade") ||
util::strieq((*i).first.c_str(), "http2-settings")) {
// These are ignored
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment