nghttpx: Remove banned header fields in HTTP2 request and response

This commit is contained in:
Tatsuhiro Tsujikawa 2013-08-26 01:02:07 +09:00
parent 4744e90054
commit 33743ab832
2 changed files with 9 additions and 10 deletions

View File

@ -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")) {

View File

@ -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;