]> granicus.if.org Git - apache/commitdiff
mod_ext_filter: Ignore any content-type parameters when checking if
authorJeff Trawick <trawick@apache.org>
Thu, 18 Jul 2002 20:31:14 +0000 (20:31 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 18 Jul 2002 20:31:14 +0000 (20:31 +0000)
the response should be filtered.  Previously, "intype=text/html"
wouldn't match something like "text/html;charset=8859_1".

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

CHANGES
modules/experimental/mod_ext_filter.c

diff --git a/CHANGES b/CHANGES
index 06cb6cb8fa6f6e5dd70783fbba618ac63c0a17bf..5c89114bbd97f3d077604172221740afe5616570 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Changes with Apache 2.0.40
 
+  *) mod_ext_filter: Ignore any content-type parameters when checking if
+     the response should be filtered.  Previously, "intype=text/html"
+     wouldn't match something like "text/html;charset=8859_1".
+     [Jeff Trawick]
+
   *) mod_ext_filter: Set up environment variables for external programs.
      [Craig Sebenik <craig@netapp.com>]
 
index 0ce3832c798a54288749c3d8d4e7371e9a2c4704..eafe3adb0659658a3b622987543ec6c5263870f0 100644 (file)
@@ -536,13 +536,21 @@ static apr_status_t init_filter_instance(ap_filter_t *f)
     }
     ctx->p = f->r->pool;
     if (ctx->filter->intype &&
-        ctx->filter->intype != INTYPE_ALL &&
-        (!f->r->content_type ||
-         strcasecmp(ctx->filter->intype, f->r->content_type))) {
-        /* wrong IMT for us; don't mess with the output */
-        ctx->noop = 1;
+        ctx->filter->intype != INTYPE_ALL) {
+        if (!f->r->content_type) {
+            ctx->noop = 1;
+        }
+        else {
+            const char *ctypes = f->r->content_type;
+            const char *ctype = ap_getword(f->r->pool, &ctypes, ';');
+
+            if (strcasecmp(ctx->filter->intype, ctype)) {
+                /* wrong IMT for us; don't mess with the output */
+                ctx->noop = 1;
+            }
+        }
     }
-    else {
+    if (!ctx->noop) {
         rv = init_ext_filter_process(f);
         if (rv != APR_SUCCESS) {
             return rv;
@@ -560,9 +568,10 @@ static apr_status_t init_filter_instance(ap_filter_t *f)
 
     if (dc->debug >= DBGLVL_SHOWOPTIONS) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r,
-                      "%sfiltering `%s' through `%s', cfg %s",
-                      ctx->noop ? "skipping: " : "",
+                      "%sfiltering `%s' of type `%s' through `%s', cfg %s",
+                      ctx->noop ? "NOT " : "",
                       f->r->uri ? f->r->uri : f->r->filename,
+                      f->r->content_type ? f->r->content_type : "(unspecified)",
                       ctx->filter->command,
                       get_cfg_string(dc, ctx->filter, f->r->pool));
     }