This is a bug in the Apache configuration. Read
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext

The server has

<IfModule mod_mime.c>
 AddEncoding x-gzip .gz
 AddEncoding x-compress .Z
 AddEncoding x-bzip2 .bz2
</IfModule>

and maybe AddType entries as well (probably via a trashy
/etc/mime.types).

It should have the more complex but correct:

<IfModule mod_mime.c>
 <FilesMatch \.gz$>
  AddEncoding x-gzip .gz
 </FilesMatch>
 <FilesMatch \.Z$>
  AddEncoding x-compress .Z
 </FilesMatch>
 <FilesMatch \.bz2$>
  AddEncoding x-bzip2 .bz2
 </FilesMatch>
</IfModule>

wget -S http://www.example.com/fred.tar.gz
  Content-Type: application/x-tar
  Content-Encoding: x-gzip

Note carefully that some browsers will now un-encode the
file prior to writing it to disk (ie, fred.tar.gz
will now save as the uncompressed fred.tar).

You can also configure Apache so that .gz.asc and
.bz2.asc are a special case prior to .asc.


# PGP
<IfModule mod_mime.c>
  AddType application/pgp-signature .sig .tar.gz.asc .tar.bz2.asc
  ...
</IfModule>
<IfModule mod_autoindex.c>
  AddDescription "PGP signature" .sig .tar.gz.asc .tar.bz2.asc
  ...
</IfModule>

# Text
<IfModule mod_mime.c>
  AddType text/plain .txt .asc
  ...
</IfModule>
<IfModule mod_autoindex.c>
  AddDescription "Text document" .txt .asc
  ...
</IfModule>


--
 Glen Turner
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to