nghttpx: Remove banned header fields in HTTP2 request and response
This commit is contained in:
parent
4744e90054
commit
33743ab832
|
@ -915,10 +915,13 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream)
|
||||||
nv[hdidx++] = response_status.c_str();
|
nv[hdidx++] = response_status.c_str();
|
||||||
for(Headers::const_iterator i = downstream->get_response_headers().begin();
|
for(Headers::const_iterator i = downstream->get_response_headers().begin();
|
||||||
i != downstream->get_response_headers().end(); ++i) {
|
i != downstream->get_response_headers().end(); ++i) {
|
||||||
if(util::strieq((*i).first.c_str(), "transfer-encoding") ||
|
if(util::strieq((*i).first.c_str(), "connection") ||
|
||||||
util::strieq((*i).first.c_str(), "keep-alive") || // HTTP/1.0?
|
util::strieq((*i).first.c_str(), "host") ||
|
||||||
util::strieq((*i).first.c_str(), "connection") ||
|
util::strieq((*i).first.c_str(), "keep-alive") ||
|
||||||
util:: strieq((*i).first.c_str(), "proxy-connection")) {
|
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
|
// These are ignored
|
||||||
} else if(!get_config()->no_via &&
|
} else if(!get_config()->no_via &&
|
||||||
util::strieq((*i).first.c_str(), "via")) {
|
util::strieq((*i).first.c_str(), "via")) {
|
||||||
|
|
|
@ -290,16 +290,12 @@ int SpdyDownstreamConnection::push_request_headers()
|
||||||
}
|
}
|
||||||
// Ignore transfer-encoding
|
// Ignore transfer-encoding
|
||||||
continue;
|
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") ||
|
} 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(), "keep-alive") ||
|
||||||
util::strieq((*i).first.c_str(), "connection") ||
|
util::strieq((*i).first.c_str(), "connection") ||
|
||||||
util::strieq((*i).first.c_str(), "proxy-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")) {
|
util::strieq((*i).first.c_str(), "http2-settings")) {
|
||||||
// These are ignored
|
// These are ignored
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue