]> granicus.if.org Git - apache/commitdiff
Switch preference for headers, Transfer-Encoding
authorRainer Jung <rjung@apache.org>
Mon, 25 Aug 2014 13:44:03 +0000 (13:44 +0000)
committerRainer Jung <rjung@apache.org>
Mon, 25 Aug 2014 13:44:03 +0000 (13:44 +0000)
first, Content-Length second.

Addition to r1615289.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620324 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index f8813691f18f163fb9fda60f6e03796ad6517b91..a8d9c18004147fb973eee8e6b2df985f95dc7f31 100644 (file)
@@ -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);
                 }