diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index f8813691f1..a8d9c18004 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1640,12 +1640,12 @@ int ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, const char *tmp; /* Add minimal headers needed to allow http_in filter * detecting end of body without waiting for a timeout. */ - if ((tmp = apr_table_get(r->headers_out, "Content-Length"))) { - apr_table_set(backend->r->headers_in, "Content-Length", tmp); - } - else if ((tmp = apr_table_get(r->headers_out, "Transfer-Encoding"))) { + if ((tmp = apr_table_get(r->headers_out, "Transfer-Encoding"))) { apr_table_set(backend->r->headers_in, "Transfer-Encoding", tmp); } + else if ((tmp = apr_table_get(r->headers_out, "Content-Length"))) { + apr_table_set(backend->r->headers_in, "Content-Length", tmp); + } else if (te) { apr_table_set(backend->r->headers_in, "Transfer-Encoding", te); }