]> granicus.if.org Git - apache/commitdiff
Safer fix to PR43882 than in r595672.
authorNick Kew <niq@apache.org>
Sat, 17 Nov 2007 14:36:58 +0000 (14:36 +0000)
committerNick Kew <niq@apache.org>
Sat, 17 Nov 2007 14:36:58 +0000 (14:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@595954 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_filters.c

index 2f1764d98fdfb8615764546529979e4357467355..0b5698d925bfa09f18b0ac71806525a0be040ad7 100644 (file)
@@ -115,11 +115,11 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
         lenp = apr_table_get(f->r->headers_in, "Content-Length");
 
         if (tenc) {
-            /* RFC2616 allows qualifiers, so use strncasecmp */
-            if (!strncasecmp(tenc, "chunked", 7) && !ap_strchr_c(tenc, ',')) {
+            if (!strcasecmp(tenc, "chunked")) {
                 ctx->state = BODY_CHUNK;
             }
-            else {
+           /* test lenp, because it gives another case we can handle */
+            else if (!lenp) {
                 /* Something that isn't in HTTP, unless some future
                  * edition defines new transfer ecodings, is unsupported.
                  */