nghttpx: Forward only "trailers" keyword in te when forwarding HTTP/2 backend

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-25 01:20:41 +09:00
parent 4042ff0fc4
commit ece8289aaf
1 changed files with 5 additions and 2 deletions

View File

@ -407,8 +407,11 @@ int Http2DownstreamConnection::push_request_headers() {
}
auto te = downstream_->get_request_header(http2::HD_TE);
if (te) {
nva.push_back(http2::make_nv_ls("te", te->value));
// HTTP/1 upstream request can contain keyword other than
// "trailers". We just forward "trailers".
// TODO more strict handling required here.
if (te && util::strifind(te->value.c_str(), "trailers")) {
nva.push_back(http2::make_nv_ll("te", "trailers"));
}
if (LOG_ENABLED(INFO)) {