]> granicus.if.org Git - apache/commitdiff
Unbreak AddOutputFilterByType for content types of the form
authorStefan Fritsch <sf@apache.org>
Sun, 23 Oct 2011 22:19:42 +0000 (22:19 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 23 Oct 2011 22:19:42 +0000 (22:19 +0000)
  text/html;charset=...,

broken by r1171268. Add some trace logging

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

modules/filters/mod_filter.c

index 829447f87242e3bd5ce82b7a2fb9fd9bb2e73d2c..dc1a4c79c33b7993271c94590d883af585fcfeb4 100644 (file)
@@ -155,17 +155,28 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
                               err);
                 match = 0;
             }
+            ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
+                          "Expression condition for '%s' %s",
+                          provider->frec->name,
+                          match ? "matched" : "did not match");
         }
         else if (r->content_type) {
             const char **type = provider->types;
             AP_DEBUG_ASSERT(type != NULL);
             while (*type) {
-                if (strcmp(*type, r->content_type) == 0) {
+                /* Handle 'content-type;charset=...' correctly */
+                size_t len = strcspn(r->content_type, "; \t");
+                if (strlen(*type) == len
+                    && strncmp(*type, r->content_type, len) == 0) {
                     match = 1;
                     break;
                 }
                 type++;
             }
+            ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
+                          "Content-Type condition for '%s' %s",
+                          provider->frec->name,
+                          match ? "matched" : "did not match");
         }
 
         if (match) {