From: Justin Erenkrantz Date: Fri, 15 Feb 2002 16:33:33 +0000 (+0000) Subject: - Unset content-length in mod_deflate so that the network-layer filters are X-Git-Tag: 2.0.33~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c35846b6dac8beb8b14aedc7d839dc587a1d2d8;p=apache - Unset content-length in mod_deflate so that the network-layer filters are free to do what they want and that no C-L is improperly returned. - Allow non-GET requests and non-html responses to be compressed. Submitted by: Sander Striker Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93428 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d6feb55f37..9d63e4ae2e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.33-dev + *) Allow mod_deflate to work with non-GET requests and properly send + Content-Lengths. [Sander Striker ] + *) Fix ap_directory_merge() to correctly merge configs when there is no block. [Justin Erenkrantz, William Rowe] diff --git a/modules/experimental/mod_deflate.c b/modules/experimental/mod_deflate.c index 8e9be6c5c2..8a3d3b057f 100644 --- a/modules/experimental/mod_deflate.c +++ b/modules/experimental/mod_deflate.c @@ -235,16 +235,6 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, return ap_pass_brigade(f->next, bb); } - /* GETs only (for the moment) */ - if (r->method_number != M_GET) { - return ap_pass_brigade(f->next, bb); - } - - /* only compress text/html files */ - if (strncmp(r->content_type, "text/html", 9)) { - return ap_pass_brigade(f->next, bb); - } - /* some browsers might have problems, so set no-gzip * (with browsermatch) for them */ if (apr_table_get(r->subprocess_env, "no-gzip")) { @@ -297,6 +287,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, apr_table_setn(r->headers_out, "Content-Encoding", "gzip"); apr_table_setn(r->headers_out, "Vary", "Accept-Encoding"); + apr_table_unset(r->headers_out, "Content-Length"); } APR_BRIGADE_FOREACH(e, bb) {