nghttpx: Reserve room for required header fields for PUSH_PROMISE

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-14 00:26:50 +09:00
parent 5005369f71
commit 1148584526
1 changed files with 2 additions and 1 deletions

View File

@ -1648,7 +1648,8 @@ int Http2Upstream::submit_push_promise(const std::string &scheme,
Downstream *downstream) {
int rv;
std::vector<nghttp2_nv> nva;
nva.reserve(downstream->get_request_headers().size());
// 4 for :method, :scheme, :path and :authority
nva.reserve(4 + downstream->get_request_headers().size());
// juse use "GET" for now
nva.push_back(http2::make_nv_ll(":method", "GET"));