From 796160cb77a1b087892ca8ac2df2cdea35344d22 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 14 May 2016 17:47:58 +0900 Subject: [PATCH] nghttpx: Don't add chunked encoded response body for HEAD request --- src/shrpx_http_downstream_connection.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index fb30782b..3840d12c 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -645,7 +645,10 @@ int htp_hdrs_completecb(http_parser *htp) { resp.connection_close = true; // transfer-encoding not applied to upgraded connection downstream->set_chunked_response(false); + } else if (!downstream->expect_response_body()) { + downstream->set_chunked_response(false); } + if (upstream->on_downstream_header_complete(downstream) != 0) { return -1; }