]> granicus.if.org Git - apache/commitdiff
* modules/proxy/proxy_http.c (ap_proxy_http_process_response):
authorJoe Orton <jorton@apache.org>
Thu, 11 Mar 2004 17:21:47 +0000 (17:21 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 11 Mar 2004 17:21:47 +0000 (17:21 +0000)
Consistently check whether r->status is "successful" or not; fix
screwy handling of 2xx-but-not-200 responses when ProxyErrorOverride
is used.

PR: 20183
Submitted by: Marcus Janson <marcus.janson@tre.se>, Joe Orton

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

CHANGES
modules/proxy/proxy_http.c

diff --git a/CHANGES b/CHANGES
index f598c8dde6fce6629f74e6e83ebdea1634760d24..ceb0b1a85ebaf06bf139f84cafb2e58c6810dfce 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_proxy: Fix handling of non-200 success status codes when
+     "ProxyErrorOverride On" is configured.  PR 20183.
+     [Marcus Janson <marcus.janson tre.se>, Joe Orton]
+
   *) Threaded MPMs for Unix and Win32: Add WorkerStackSize directive
      to override default thread stack size for threads which handle
      client connections.  Required for some third-party modules on
index c45549d33180de45a9b74da58ce2fff9bcc7a379..f695cd7aa163e8135b07f3309b7f4a16a17b5599 100644 (file)
@@ -990,7 +990,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
              * if we are overriding the errors, we can't put the content
              * of the page into the brigade
              */
-            if ( (conf->error_override ==0) || r->status < 300 ) {
+            if (conf->error_override == 0 || ap_is_HTTP_SUCCESS(r->status)) {
 
                 /* read the body, pass it to the output filters */
                 int finish = FALSE;
@@ -1050,11 +1050,11 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
         }
     } while (interim_response);
 
-    if ( conf->error_override ) {
+    if (conf->error_override) {
         /* the code above this checks for 'OK' which is what the hook expects */
-        if ( r->status == HTTP_OK )
+        if (ap_is_HTTP_SUCCESS(r->status))
             return OK;
-        else  {
+        else {
             /* clear r->status for override error, otherwise ErrorDocument
              * thinks that this is a recursive error, and doesn't find the
              * custom error page