From 2ca8f506a172677a53cd1b90bfa9ce9483680d80 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 7 May 2014 12:50:35 +0000 Subject: [PATCH] Merge r1584430, r1584434 from trunk: mod_expires: don't add Expires header to error responses (4xx/5xx), be they generated or forwarded. PR 55669. Follow up to r1584430. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1592999 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 7 ------- modules/metadata/mod_expires.c | 6 ++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 613eac5cbc..b300af53b5 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.4.10 + *) mod_expires: don't add Expires header to error responses (4xx/5xx), + be they generated or forwarded. PR 55669. [ Yann Ylavic ] + *) mod_proxy_fcgi: Don't segfault when failing to connect to the backend. (regression in 2.4.9 release) [Jeff Trawick] diff --git a/STATUS b/STATUS index b91a6cbb84..8038c4b039 100644 --- a/STATUS +++ b/STATUS @@ -100,13 +100,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_expires: don't add Expires header to error responses (4xx/5xx), - be they generated or forwarded. PR 55669. - trunk patch: http://svn.apache.org/r1584430 - http://svn.apache.org/r1584434 - 2.4.x patch: trunk works (modulo CHANGES) - +1: ylavic, covener, jim - * mod_cache: Fix CacheLock on Windows trunk patch: http://svn.apache.org/r1588704 2.4.x patch: trunk works diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index 049cfc2250..8f8a777693 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -451,6 +451,12 @@ static apr_status_t expires_filter(ap_filter_t *f, const char *expiry; apr_table_t *t; + /* Don't add Expires headers to errors */ + if (ap_is_HTTP_ERROR(f->r->status)) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, b); + } + r = f->r; conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config, &expires_module); -- 2.40.0