]> granicus.if.org Git - apache/commitdiff
Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
authorChristophe Jaillet <jailletc36@apache.org>
Tue, 16 Oct 2012 20:07:30 +0000 (20:07 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Tue, 16 Oct 2012 20:07:30 +0000 (20:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398970 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_filter.c

index 06e4d7a204b694085bce07df52f182e06754b15c..2d8e8b6595ba4d00a8676fcbdc6d8c052668081c 100644 (file)
@@ -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);
                     }