PR53420: Proxy responses with error status and
"ProxyErrorOverride On" hang until proxy timeout.
Regression from 2.2. It was introduced by r912063
in order to fix PR41646.
Switch preference for headers, Transfer-Encoding
first, Content-Length second.
Addition to r1615289.
Submitted by: rjung
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1621601 13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.4.11
+ *) mod_proxy_http: Proxy responses with error status and
+ "ProxyErrorOverride On" hang until proxy timeout.
+ PR53420 [Rainer Jung]
+
*) SECURITY: CVE-2013-5704 (cve.mitre.org)
core: HTTP trailers could be used to replace HTTP headers
late during request processing, potentially undoing or
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_proxy_http: Proxy responses with error status and "ProxyErrorOverride On"
- hang until proxy timeout. PR53420
- Regression from 2.2. It was introduced by r912063 in order to fix PR41646.
- trunk patch: http://svn.apache.org/r1615289
- http://svn.apache.org/r1620324
- 2.4.x patch: trunk works (modulo CHANGES)
- +1: rjung, ylavic, covener
-
* mod_proxy_fcgi: Fix faulty logging of large amounts of stderr from the
application. PR 56858.
trunk patch: http://svn.apache.org/r1618401
if (!r->header_only && /* not HEAD request */
(proxy_status != HTTP_NO_CONTENT) && /* not 204 */
(proxy_status != HTTP_NOT_MODIFIED)) { /* not 304 */
+ 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, "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);
+ }
ap_discard_request_body(backend->r);
}
return proxy_status;