From: Yann Ylavic Date: Tue, 10 Feb 2015 17:03:05 +0000 (+0000) Subject: mod_proxy_http: Don't expect the backend to ack the "Connection: close" to X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7cceb97a9a034ddef82fb09eaabec4c7285aa19;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy_http: Don't expect the backend to ack the "Connection: close" to finally close those not meant to be kept alive by SetEnv proxy-nokeepalive or force-proxy-request-1.0, and respond with 502 instead of 400 if its Connection header is invalid. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1658760 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index df387bb7e9a..4a0d059c6e7 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,11 @@ Changes with Apache 2.5.0 calls r:wsupgrade() can cause a child process crash. [Edward Lu ] + *) mod_proxy_http: Don't expect the backend to ack the "Connection: close" to + finally close those not meant to be kept alive by SetEnv proxy-nokeepalive + or force-proxy-request-1.0, and respond with 502 instead of 400 if its + Connection header is invalid. [Yann Ylavic] + *) mod_authn_dbd: Fix the error message logged in case of error while querying the database. This is associated to AH01656 and AH01661. [Christophe Jaillet] diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index ddab4a2f021..0a27a52d507 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1548,10 +1548,12 @@ int ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* strip connection listed hop-by-hop headers from response */ toclose = ap_proxy_clear_connection_fn(r, r->headers_out); - backend->close = (toclose != 0); - if (toclose < 0) { - return ap_proxyerror(r, HTTP_BAD_REQUEST, - "Malformed connection header"); + if (toclose) { + backend->close = 1; + if (toclose < 0) { + return ap_proxyerror(r, HTTP_BAD_GATEWAY, + "Malformed connection header"); + } } if ((buf = apr_table_get(r->headers_out, "Content-Type"))) {