apt-get update: gzip: stdin: not in gzip format
Finally found the solution to a long-standing annoyance.
Since installing DansGuardian on our firewall/proxy system, some
debian package sources have been inacessible through the apt-get system.
The symptom is that some (but not all) debian sources will produce an
error when running "apt-get update". Here is an example:
gzip: stdin: not in gzip format
Err http://people.debian.org wine/main Packages
Sub-process gzip returned an error code (1)
The problem is this:
Many webservers are configured to compress their content before
sending, to reduce bandwidth. In order to read the original file,
DansGuardian decompresses the input prior to applying its filtering
rules. If DansGuardian thinks the original file was *not* compressed,
(i.e. the compression was done by the webserver), it simply pass the
decompressed file on to the browser.
To figure out whether the original file was compressed, DansGuardian
looks at the mime-type in the HTTP headers.
The affected systems deliver the "Packages.gz" and "Sources.gz" files
with the following HTTP headers:
Other debian sources deliver the same files with these HTTP headers:
I'm currently testing a patch to the Dansguardian sources which
works around the problem, by explicitly testing for "text/plain"
content and refusing to decompress in that case.
1. Is this a bug in Dansguardian, or is it the fault of the webservers
which deliver incorrect Content-Type: headers?
2. Should I post my work-around patch? Is there a better way?