diff options
Diffstat (limited to 'modules/proxy/proxy_http.c')
-rw-r--r-- | modules/proxy/proxy_http.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index aa1e08dd7a..05881edfa1 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -860,6 +860,17 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, } } + if ((r->status == 401) && (conf->error_override != 0)) { + const char *buf; + const char *wa = "WWW-Authenticate"; + if (buf = apr_table_get(r->headers_out, wa)) { + apr_table_set(r->err_headers_out, wa, buf); + } else { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: origin server sent 401 without w-a header"); + } + } + r->sent_bodyct = 1; /* Is it an HTTP/0.9 response? If so, send the extra data */ if (backasswards) { @@ -966,6 +977,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, */ int status = r->status; r->status = HTTP_OK; + ap_discard_request_body(rp); return status; } } else |