[MKDoc-commit] Fix bug introduced yesterday that caused all content to be gzipped

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Fri Feb 4 11:20:23 GMT 2005


Log Message:
-----------
Fix bug introduced yesterday that caused all content to be gzipped

Modified Files:
--------------
    MKDoc-Apache_Cache/lib/MKDoc:
        Apache_Cache.pm

-------------- next part --------------
Index: Apache_Cache.pm
===================================================================
RCS file: /var/spool/cvs/MKDoc-Apache_Cache/lib/MKDoc/Apache_Cache.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -Llib/MKDoc/Apache_Cache.pm -Llib/MKDoc/Apache_Cache.pm -u -r1.16 -r1.17
--- lib/MKDoc/Apache_Cache.pm
+++ lib/MKDoc/Apache_Cache.pm
@@ -84,12 +84,11 @@
 
     # if the client doesn't support gzip, fix the headers,
     # ungzip && send.
-    if ($ENV{'HTTP_ACCEPT_ENCODING'})
-    {
+    $ENV{HTTP_ACCEPT_ENCODING} ||= '';
     lc $ENV{'HTTP_ACCEPT_ENCODING'} !~ /gzip/ and do {
 
         my ($headers, $body) = split /\r?\n\r?\n/, $data, 2;
-        $body = '' unless ($body);
+        $body ||= '';
         $headers = join "\r\n",
                    grep !/content-length\:/i,
                    grep !/content-encoding\:/i,
@@ -99,7 +98,6 @@
         $headers .= "\r\nContent-Length: " . length ($body) if ($body);
         $data = $headers . "\r\n\r\n" . $body;
     };
-    };
 
     $ENV{REQUEST_METHOD} =~ /HEAD/i and do {
         $data =~ s/\r?\ncontent-length\:.*//i;


More information about the MKDoc-commit mailing list