From 3971360854c0189e33a18ba74b1db87b03b11934 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 23 Oct 2011 22:19:42 +0000 Subject: [PATCH] Unbreak AddOutputFilterByType for content types of the form 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index 829447f872..dc1a4c79c3 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -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) { -- 2.50.1