diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 1c6af673..42a347fb 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -1471,9 +1471,9 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) { nva.push_back(http2::make_nv_ls(":status", response_status)); } - http2::copy_headers_to_nva_nocopy(nva, downstream->get_response_headers()); - if (downstream->get_non_final_response()) { + http2::copy_headers_to_nva(nva, downstream->get_response_headers()); + if (LOG_ENABLED(INFO)) { log_response_headers(downstream, nva); } @@ -1492,6 +1492,8 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) { return 0; } + http2::copy_headers_to_nva_nocopy(nva, downstream->get_response_headers()); + if (!get_config()->http2_proxy && !get_config()->client_proxy) { nva.push_back( http2::make_nv_lc_nocopy("server", get_config()->server_name));