From 1948bf5f9a1b7213dfb8c8dec02b60859ffb335a Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Tue, 16 Oct 2012 20:07:30 +0000 Subject: [PATCH] Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398970 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_filter.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index 06e4d7a204..2d8e8b6595 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -221,9 +221,7 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter) const char *str = apr_table_get(r->headers_out, "Cache-Control"); if (str) { - char *str1 = apr_pstrdup(r->pool, str); - ap_str_tolower(str1); - if (strstr(str1, "no-transform")) { + if (ap_strcasestr(str, "no-transform")) { /* can't use this provider; try next */ continue; } @@ -278,7 +276,6 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb) apr_status_t ret; #ifndef NO_PROTOCOL const char *cachecontrol; - char *str; #endif harness_ctx *ctx = f->ctx; ap_filter_rec_t *filter = f->frec; @@ -304,9 +301,7 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb) cachecontrol = apr_table_get(f->r->headers_out, "Cache-Control"); if (cachecontrol) { - str = apr_pstrdup(f->r->pool, cachecontrol); - ap_str_tolower(str); - if (strstr(str, "no-transform")) { + if (ap_strcasestr(cachecontrol, "no-transform")) { ap_remove_output_filter(f); return ap_pass_brigade(f->next, bb); } -- 2.40.0