On Mon, Jul 07, 2003 at 07:01:23PM -0500, Michael A. Miller wrote: > >>>>> "Robert" == Robert August Vincent <[EMAIL PROTECTED]> writes: > > > Question: > > > 1. Is this a bug in Dansguardian, or is it the fault of the > > webservers which deliver incorrect Content-Type: headers? > > Sounds like Dansguardian is at fault to me. Have you submitted a > bug report for the Debian package?
Yup. > > > 2. Should I post my work-around patch? Is there a better > > way? > > Please post it. I've been trying so sort out the same problem. > Thanks to your finding the root of it, I've been solving it by > doing an unset http_proxy before running apt-get. There's got to > be a better way... Attached. All it does is check for the above-listed headers and turn-off decompression in that case. Not very robust.
diff -u dansguardian-2.5.2-0/ConnectionHandler.cpp dansguardian-2.5.2-0-patched/ConnectionHandler.cpp --- dansguardian-2.5.2-0/ConnectionHandler.cpp 2002-11-07 19:44:10.000000000 -0500 +++ dansguardian-2.5.2-0-patched/ConnectionHandler.cpp 2003-07-05 22:47:50.000000000 -0400 @@ -401,7 +401,7 @@ waschecked = true; proxysock.checkForInput(60); - if (docheader.isCompressed()) { + if (docheader.isCompressed() && !docheader.iscontenttype("text/plain")) { docbody.setDecompress(docheader.contentEncoding()); #ifdef DGDEBUG std::cout << docheader.contentEncoding() << std::endl; @@ -418,7 +418,7 @@ int dblen = docbody.length(); docsize = dblen; - if (docheader.isCompressed()) { + if (docheader.isCompressed() && !docheader.iscontenttype("text/plain")) { docheader.removeEncoding(dblen); // need to modify header to mark as not compressed // it also modifies Content-Length as well