From: Jim Jagielski Date: Mon, 12 Jul 2010 18:49:31 +0000 (+0000) Subject: *) mod_filter: enable filtering of errordocuments. PR 48377 X-Git-Tag: 2.2.16~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=804874633e178f3407272de9837d259f46f97729;p=thirdparty%2Fapache%2Fhttpd.git *) mod_filter: enable filtering of errordocuments. PR 48377 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@963431 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index fd9fcd0987d..d43247ea231 100644 --- a/STATUS +++ b/STATUS @@ -86,9 +86,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_filter: enable filtering of errordocuments. PR 48377 - http://svn.apache.org/viewvc?view=revision&revision=894041 - +1: niq, rjung, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/docs/manual/mod/mod_filter.xml b/docs/manual/mod/mod_filter.xml index f754e680748..3ef642e754e 100644 --- a/docs/manual/mod/mod_filter.xml +++ b/docs/manual/mod/mod_filter.xml @@ -125,6 +125,13 @@ filters declared, offering the flexibility to insert filters at the beginning or end of the chain, remove a filter, or clear the chain. +
Filtering and Response Status +

mod_filter normally only runs filters on responses with + HTTP status 200 (OK). If you want to filter documents with + other response statuses, you can set the filter-errordocs + environment variable, and it will work on all responses + regardless of status. To refine this further, you can use + expression conditions with FilterProvider.

Examples diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index 73893642467..c09f3f937e6 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -346,7 +346,8 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb) harness_ctx *ctx = f->ctx; ap_filter_rec_t *filter = f->frec; - if (f->r->status != 200) { + if (f->r->status != 200 + && !apr_table_get(f->r->subprocess_env, "filter-errordocs")) { ap_remove_output_filter(f); return ap_pass_brigade(f->next, bb); }