07ea28
--- a/modules/proxy/mod_proxy_http.c	2014/08/31 16:06:36	1621600
07ea28
+++ b/modules/proxy/mod_proxy_http.c	2014/08/31 16:07:45	1621601
07ea28
@@ -1652,6 +1652,18 @@
07ea28
             if (!r->header_only && /* not HEAD request */
07ea28
                 (proxy_status != HTTP_NO_CONTENT) && /* not 204 */
07ea28
                 (proxy_status != HTTP_NOT_MODIFIED)) { /* not 304 */
07ea28
+                const char *tmp;
07ea28
+                /* Add minimal headers needed to allow http_in filter
07ea28
+                 * detecting end of body without waiting for a timeout. */
07ea28
+                if ((tmp = apr_table_get(r->headers_out, "Transfer-Encoding"))) {
07ea28
+                    apr_table_set(backend->r->headers_in, "Transfer-Encoding", tmp);
07ea28
+                }
07ea28
+                else if ((tmp = apr_table_get(r->headers_out, "Content-Length"))) {
07ea28
+                    apr_table_set(backend->r->headers_in, "Content-Length", tmp);
07ea28
+                }
07ea28
+                else if (te) {
07ea28
+                    apr_table_set(backend->r->headers_in, "Transfer-Encoding", te);
07ea28
+                }
07ea28
                 ap_discard_request_body(backend->r);
07ea28
             }
07ea28
             return proxy_status;