--- ../../squid-2.3.STABLE4/src/client_side.c Mon Jun 17 14:21:28 2002 +++ client_side.c Mon Jun 17 14:49:42 2002 @@ -1186,6 +1186,37 @@ if (request->flags.filter) http->filter = moduleCFilterNew( httpHeaderGetStr(hdr, HDR_CONTENT_TYPE), http->uri, rep); + /* + PB: gziped data isn't being handled correctly. + This is a kludge and supported should be added + to HtmlFilter.c for various type/encoding combinations. + + Update (as of 0.7 (April 2001)) this issue is mentioned (thanks to me), + and a method for configuring around the problem is mentioned in the docs. + A paraphrased version is reproduced here: + + "Content filters get the data as delivered by the server. With a + non-identity Content-Encoding the filter would operate on the + encoded data, which it generally can not process correctly. (It has + been confirmed by experience that HTML filters like script.so + applied to a file with compression encoding will silently deliver + corrupted files. + + For this reason, the Accept-Encoding headers should always be + filtered out with an appropriate anonymize_headers clause. + This causes the origin server to always send unencoded data." + + I don't see any problem with using both moethods. + */ + if (http->filter) + if (httpHeaderHas(hdr, HDR_CONTENT_ENCODING)) { + String enc = httpHeaderGetList(hdr, HDR_CONTENT_ENCODING); + debug(93, 3) ("clientSendMoreData: filtering Content-Encoding[%s] (from [%s]) not supported\n", strBuf(enc), http->uri); + stringClean(&enc); + moduleCFilterDestroy(http->filter); + http->filter=NULL; + } + /* Kill Ranges if filtered */ if (http->filter && request->range) { httpHdrRangeDestroy(request->range);