diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 6455aec9..859eea2e 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -1648,7 +1648,8 @@ int Http2Upstream::submit_push_promise(const std::string &scheme, Downstream *downstream) { int rv; std::vector 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"));