From: Jeff Trawick
Date: Thu, 12 Apr 2007 15:07:11 +0000 (+0000)
Subject: HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
X-Git-Tag: 2.3.0~1838
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b9efbf9caabb9e637cb6cbe9e446270020c9daa;p=apache
HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
processing of error responses (4xx, 5xx) will be altered.
PR: 39245
This is based on a patch submitted by Bart van der Schans
and tweaked slightly by me based on discussions on dev@ since April 2006.
I think rpleum was the first to mention the 1xx issue.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@527969 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/CHANGES b/CHANGES
index cb322e0a43..605ad96261 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
Changes with Apache 2.3.0
[Remove entries to the current 2.0 and 2.2 section below, when backported]
+ *) HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
+ processing of error responses (4xx, 5xx) will be altered. PR 39245.
+ [Jeff Trawick, Bart van der Schans ]
+
*) htdbm: Enable crypt support on platforms with crypt() but not
, such as z/OS. [David Jones ]
diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml
index 20ef6775aa..b4230fdbf1 100644
--- a/docs/manual/mod/mod_proxy.xml
+++ b/docs/manual/mod/mod_proxy.xml
@@ -1196,6 +1196,9 @@ header for proxied requests
the error code and act accordingly (default behavior would display
the error page of the proxied server, turning this on shows the SSI
Error message).
+
+ This directive does not affect the processing of informational (1xx),
+ normal success (2xx), or redirect (3xx) responses.
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c
index 233903bef2..41af69fe4d 100644
--- a/modules/proxy/mod_proxy_http.c
+++ b/modules/proxy/mod_proxy_http.c
@@ -1448,7 +1448,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 || ap_is_HTTP_SUCCESS(r->status)) {
+ if (!conf->error_override || !ap_is_HTTP_ERROR(r->status)) {
/* read the body, pass it to the output filters */
apr_read_type_e mode = APR_NONBLOCK_READ;
int finish = FALSE;
@@ -1557,7 +1557,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
if (conf->error_override) {
/* the code above this checks for 'OK' which is what the hook expects */
- if (ap_is_HTTP_SUCCESS(r->status))
+ if (!ap_is_HTTP_ERROR(r->status))
return OK;
else {
/* clear r->status for override error, otherwise ErrorDocument