From: Yann Ylavic Date: Mon, 12 Dec 2016 19:44:20 +0000 (+0000) Subject: Follow up to r1773761: we need to check both ap_send_error_response() and internal... X-Git-Tag: 2.5.0-alpha~921 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=749c178790406cc3f5df9e00bc1b15f389def705;p=apache Follow up to r1773761: we need to check both ap_send_error_response() and internal redirect recursions. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773862 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 21523c5cbd..65607df739 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -1249,11 +1249,11 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, apr_table_clear(r->headers_out); apr_table_clear(r->err_headers_out); - /* Don't try ErrorDocument if we are (internal-)redirect-ed already, - * otherwise we can end up in infinite recursion, better fall through - * with 500, minimal headers and an empty body (EOS only). + /* Don't try ErrorDocument if we are (internal-)redirect-ed or dying + * already, otherwise we can end up in infinite recursion, better fall + * through with 500, minimal headers and an empty body (EOS only). */ - if (!dying) { + if (ap_is_initial_req(r) && !dying) { apr_brigade_cleanup(b); apr_pool_userdata_setn("true", "http_header_filter_dying", apr_pool_cleanup_null, r->pool);