]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_fcgi: avoid loops serving proxied error documents
authorLuca Toscano <elukey@apache.org>
Mon, 18 Jul 2016 08:02:23 +0000 (08:02 +0000)
committerLuca Toscano <elukey@apache.org>
Mon, 18 Jul 2016 08:02:23 +0000 (08:02 +0000)
This commit should solve the issue indicated in PR 55415.
Httpd loops while serving a error document if:
1) The error document's content is proxied.
2) ProxyErrorOverride is set.
The solution proposed is to limit the use of ap_die only
to the initial request. I tested the change with very basic
scenarios but I am not sure if I got all the use cases,
feedback is really welcome.

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

CHANGES
modules/proxy/mod_proxy_fcgi.c

diff --git a/CHANGES b/CHANGES
index dcf337a16690a27b86d5436b1e3052915918a375..5b6de8c8b3ad5b2112f2ca0d08fd06ddfc0a274a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_fcgi: avoid loops when ProxyErrorOverride is enabled
+     and the error documents are proxied. PR 55415. [Luca Toscano]
+
   *) mod_proxy_fcgi: read the whole FCGI response even when the content has
      not been modified (HTTP 304) to avoid subsequent bogus reads and
      confusing error messages logged. [Luca Toscano]
index 7737642806cc6a31d034ea0b914233c821b2d9f4..2a760fcb0255c74398215d97e2424ae3f9661ec6 100644 (file)
@@ -678,8 +678,8 @@ recv_again:
                                 }
                             }
 
-                            if (conf->error_override &&
-                                ap_is_HTTP_ERROR(r->status)) {
+                            if (conf->error_override
+                                && ap_is_HTTP_ERROR(r->status) && ap_is_initial_req(r)) {
                                 /*
                                  * set script_error_status to discard
                                  * everything after the headers