From a636051074bcc7ce4370bb09a13856ddbdd7eea7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 11 Mar 2004 17:21:47 +0000 Subject: [PATCH] * modules/proxy/proxy_http.c (ap_proxy_http_process_response): 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 , Joe Orton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102935 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/proxy_http.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index f598c8dde6..ceb0b1a85e 100644 --- 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 , 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 diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index c45549d331..f695cd7aa1 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -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 -- 2.50.1