Bug 45799 - mod_deflate is conpressing wrong content
Summary: mod_deflate is conpressing wrong content
Status: RESOLVED DUPLICATE of bug 33499
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.2.3
Hardware: PC Windows Vista
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-13 03:28 UTC by Charles
Modified: 2008-09-13 06:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles 2008-09-13 03:28:09 UTC
I have installed mod_deflate on Apache lately, everything seems ok, except there is one issue where some Content-type: application/x-download data are getting compressed, even though I didn't specify it in the deflate configuration. This causes the content-length to be set incorrectly to 0, which causes the loading progress bar to be incorrect.

This problem started to occur when mod_deflate is enabled. I don't know if this is a mod_deflate issue, or the interaction problems with some other Apache modules.

The following is the deflate config, as well as the HTTP response header.

<IfModule mod_deflate.c>
  # Compress contents that of a certain type
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/atom_xml
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/x-httpd-php
  AddOutputFilterByType DEFLATE application/x-httpd-fastphp
  AddOutputFilterByType DEFLATE application/x-httpd-eruby
  AddOutputFilterByType DEFLATE text/html

  # properly handle requests coming from behind proxies
  <IfModule mod_headers.c>
      Header append Vary User-Agent env=!dont-vary
  </IfModule>

  # Properly handle old browsers that do not support compression
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>


==============================================

(Status-Line)	HTTP/1.1 200 OK
Date	Sat, 13 Sep 2008 10:04:11 GMT
Server	Apache
X-Powered-By	PHP/5.1.6
Expires	Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control	no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma	no-cache
content-disposition	attachment; filename=go.go
Content-Transfer-Encoding	binary
Vary	Accept-Encoding
Content-Encoding	gzip
Keep-Alive	timeout=15, max=100
Connection	Keep-Alive
Transfer-Encoding	chunked
Content-Type	application/x-download
Comment 1 Nick Kew 2008-09-13 06:06:54 UTC
This is just well-known AddOutputFilterByType brokenness.  The simple fix is to use FilterProvider/FilterChain.

*** This bug has been marked as a duplicate of bug 33499 ***