]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* mod_filter: FilterProvider conditions of type "resp=" (response headers)
authorJim Jagielski <jim@apache.org>
Mon, 29 Aug 2011 15:19:23 +0000 (15:19 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 29 Aug 2011 15:19:23 +0000 (15:19 +0000)
    do not work for CGI, because headers_out are not populated. We need to use
    err_headers_out instead in this case. In trunk this is handled by ap_expr().
    Joe recently added fall back to err_headers_out to ap_expr and the proposed
    mod_filter patch is analogous to Joe's fix.
    The patch fixes the test suite failure for t/modules/filter.t.
    Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1090234
    2.2.x patch: http://people.apache.org/~rjung/patches/mod_filter-cgi-err_headers_out.patch
    +1: rjung, jorton, sf

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1162852 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/filters/mod_filter.c

diff --git a/STATUS b/STATUS
index 0cb4d9d84813332577ea0243451b4ed7b07d1305..1c6dcd69d36523c3117112de28f2c1faeb4556f5 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -92,16 +92,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * mod_filter: FilterProvider conditions of type "resp=" (response headers)
-    do not work for CGI, because headers_out are not populated. We need to use
-    err_headers_out instead in this case. In trunk this is handled by ap_expr().
-    Joe recently added fall back to err_headers_out to ap_expr and the proposed
-    mod_filter patch is analogous to Joe's fix.
-    The patch fixes the test suite failure for t/modules/filter.t.
-    Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1090234
-    2.2.x patch: http://people.apache.org/~rjung/patches/mod_filter-cgi-err_headers_out.patch
-    +1: rjung, jorton, sf
-
   * Sort hooks before running pre-config hook.
     Trunk patch: http://svn.apache.org/viewvc?rev=1032002&view=rev
       (Omit trunk's config*m4 change which adjusted the order of statically
@@ -127,10 +117,10 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
     Trunk patch: Was never in trunk.
     2.2.x patch: http://people.apache.org/~sf/PR44020.diff
     +1: sf
-    +0: covener did you see Jim's initial concern on introducing the 
-        ap_construct_url() in maintenance?  This dissuaded me from 
+    +0: covener did you see Jim's initial concern on introducing the
+        ap_construct_url() in maintenance?  This dissuaded me from
         proposing the same.
-    sf replies: I think that was mainly refering to the fact that in the 
+    sf replies: I think that was mainly refering to the fact that in the
                 !ap_is_url(ret) case, the trunk version returns internal
                 server error while the 2.2 version just does nothing.
                 In that case, there is a log message with level error, but
@@ -163,9 +153,9 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
     Now we exclude a list of vars which we know for sure they
     dont hold UTF-8 chars; all other vars will be fixed. This
     has the benefit that now also all vars from 3rd-party modules
-    will be fixed. This fix is based on PR 13029 / 34985, and 
+    will be fixed. This fix is based on PR 13029 / 34985, and
     includes now the SSL_ and GEOIP_ vars; otherwise its impossible
-    to run CGIs when mod_ssl and/or mod_geoip are loaded and those 
+    to run CGIs when mod_ssl and/or mod_geoip are loaded and those
     mods return UTF-8 chars in any var during a request.
     Trunk patch: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/win32/mod_win32.c?r1=1054347&r2=1146932
     2.2.x patch: http://people.apache.org/~fuankg/diffs/2.2.x-mod_win32.c.diff
@@ -290,7 +280,7 @@ PATCHES/ISSUES THAT ARE STALLED
               need to be added to this. See also
               http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/%3c20060723093125.GA19423@redhat.com%3e
               and follow ups for more details.
-      needs r930063 to avoid a memory leak, +1 with r930063.      
+      needs r930063 to avoid a memory leak, +1 with r930063.
 
  * prefork MPM: simple patch to enable mod_privileges.
    trunk: N/A (this patch substitutes for the availability of
@@ -304,7 +294,7 @@ PATCHES/ISSUES THAT ARE STALLED
    Trunk Patch: http://cvs.apache.org/viewvc?view=rev&revision=791337
    2.2.x Patch: https://issues.apache.org/bugzilla/attachment.cgi?id=20004
    +1: niq
-   -0: wrowe; Please refer to man 'access' BUGS section about linux 2.4 
+   -0: wrowe; Please refer to man 'access' BUGS section about linux 2.4
               vs 2.6 kernels, potentially a suspect test for root.
    sf:        Couldn't the linux 2.4 bug be worked around by calling access
               twice? Once with R_OK and once with X_OK.
index c09f3f937e6a559bfdde9d05fe8a683df4c5a4fc..cbabd48060d20c1db5cb8428af07948224aa0bdc 100644 (file)
@@ -184,7 +184,12 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
             str = apr_table_get(r->headers_in, provider->value);
             break;
         case RESPONSE_HEADERS:
+            /* Try r->headers_out first, fall back on err_headers_out. */
             str = apr_table_get(r->headers_out, provider->value);
+            if (str) {
+                break;
+            }
+            str = apr_table_get(r->err_headers_out, provider->value);
             break;
         case SUBPROCESS_ENV:
             str = apr_table_get(r->subprocess_env, provider->value);