]> granicus.if.org Git - apache/commitdiff
mod_expires: don't add Expires header to error responses (4xx/5xx),
authorYann Ylavic <ylavic@apache.org>
Thu, 3 Apr 2014 22:20:15 +0000 (22:20 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 3 Apr 2014 22:20:15 +0000 (22:20 +0000)
             be they generated or forwarded. PR 55669.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584430 13f79535-47bb-0310-9956-ffa450edef68

modules/metadata/mod_expires.c

index 049cfc2250961029d993a00e601f7c538ede2aaf..8f8a7776939c73ea331b3e9f2d7bd6369f4eeebd 100644 (file)
@@ -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);