[MKDoc-commit] Turn off some "uninitialized value" warnings when delivering content to

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Wed Feb 2 18:06:11 GMT 2005


Log Message:
-----------
Turn off some "uninitialized value" warnings when delivering content to
clients that don't specify accept-encoding:

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.11
retrieving revision 1.12
diff -Llib/MKDoc/Apache_Cache.pm -Llib/MKDoc/Apache_Cache.pm -u -r1.11 -r1.12
--- lib/MKDoc/Apache_Cache.pm
+++ lib/MKDoc/Apache_Cache.pm
@@ -84,6 +84,8 @@
 
     # if the client doesn't support gzip, fix the headers,
     # ungzip && send.
+    if ($ENV{'HTTP_ACCEPT_ENCODING'})
+    {
     lc $ENV{'HTTP_ACCEPT_ENCODING'} !~ /gzip/ and do {
 
         my ($headers, $body) = split /\r?\n\r?\n/, $data, 2;
@@ -96,6 +98,7 @@
         $headers .= "\r\nContent-Length: " . length ($body);
         $data = $headers . "\r\n\r\n" . $body;
     };
+    };
 
     $ENV{REQUEST_METHOD} =~ /HEAD/i and do {
         $data =~ s/\r?\ncontent-length\:.*//i;
@@ -227,7 +230,6 @@
  
     # Vary: Accept-Encoding is here to tell proxies to keep a separate
     # cache for every different Accept-Encoding that is being sent.
-    $_ = lc( $ENV{'HTTP_ACCEPT_ENCODING'} );
     $content_type !~ /zip/ and $content_type =~ /(text|xml)/ and do {
         $body = Compress::Zlib::memGzip ($body);
         push @o, "Content-Encoding: gzip";


More information about the MKDoc-commit mailing list