]> granicus.if.org Git - apache/commitdiff
mod_deflate - discussion on dev@
authorNick Kew <niq@apache.org>
Mon, 6 Aug 2007 13:53:35 +0000 (13:53 +0000)
committerNick Kew <niq@apache.org>
Mon, 6 Aug 2007 13:53:35 +0000 (13:53 +0000)
Postpone unsetting of headers until after first get_brigade from upstream

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

modules/filters/mod_deflate.c

index 3c4f8d7d45759a1104b70133a1eda15042891219..365a8378fec8a77f0e77fb22eb31c0636bcf7474 100644 (file)
@@ -726,9 +726,6 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
             ap_remove_input_filter(f);
             return ap_get_brigade(f->next, bb, mode, block, readbytes);
         }
-        apr_table_unset(r->headers_in, "Content-Length");
-        apr_table_unset(r->headers_in, "Content-MD5");
-        apr_table_unset(r->headers_in, "Content-Range");
 
         f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
         ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
@@ -740,6 +737,10 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
             return rv;
         }
 
+        apr_table_unset(r->headers_in, "Content-Length");
+        apr_table_unset(r->headers_in, "Content-MD5");
+        apr_table_unset(r->headers_in, "Content-Range");
+
         len = 10;
         rv = apr_brigade_flatten(ctx->bb, deflate_hdr, &len);
         if (rv != APR_SUCCESS) {