vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[miscperl] r258: Revert using LJ::Request

Committer: vad
Revert using LJ::Request
U   trunk/Apache/CompressClientFixup.pm
Modified: trunk/Apache/CompressClientFixup.pm
===================================================================
--- trunk/Apache/CompressClientFixup.pm	2010-01-19 08:24:19 UTC (rev 257)
+++ trunk/Apache/CompressClientFixup.pm	2010-01-19 08:36:50 UTC (rev 258)
@@ -1,4 +1,4 @@
-# modified from:/
+# modified from: 
 #    http://devl4.outlook.net/devdoc/Dynagzip/ContentCompressionClients.html
 
 package Apache::CompressClientFixup;
@@ -13,15 +13,15 @@
 $VERSION = "0.01";
 
 sub handler {
-    #my $r = shift;
-    return DECLINED unless LJ::Request->header_in('Accept-Encoding') =~ /gzip/io;
+    my $r = shift;
+    return DECLINED unless $r->header_in('Accept-Encoding') =~ /gzip/io;
 
     my $no_gzip = sub { 
-        LJ::Request->unset_header_in('Accept-Encoding');
+        $r->headers_in->unset('Accept-Encoding');
         return OK;
     };
 
-    my $ua = LJ::Request->header_in('User-Agent');
+    my $ua = $r->header_in('User-Agent');
 
  #   if ($r->protocol =~ /http\/1\.0/io) {
  #       # it is not supposed to be compressed:
@@ -31,16 +31,16 @@
 
     if ($ua =~ /MSIE 4\./o) {
         return $no_gzip->() if 
-            LJ::Request->method =~ /POST/io ||
-            LJ::Request->header_in('Range') ||
-            length(LJ::Request->uri) > 245;
+            $r->method =~ /POST/io ||
+            $r->header_in('Range') ||
+            length($r->uri) > 245;
     }
     if ($ua =~ /MSIE 6\.0/o) {
-        return $no_gzip->() if LJ::Request->parsed_uri->scheme =~ /https/io;
+        return $no_gzip->() if $r->parsed_uri->scheme =~ /https/io;
     }
 
-    if (LJ::Request->header_in('Via') =~ /^1\.1\s/o ||  # MS Proxy 2.0
-        LJ::Request->header_in('Via') =~ /^Squid\//o ||
+    if ($r->header_in('Via') =~ /^1\.1\s/o ||  # MS Proxy 2.0
+        $r->header_in('Via') =~ /^Squid\//o ||
         $ua =~ /Galeon\)/o ||
         $ua =~ /Mozilla\/4\.7[89]/o ||
         $ua =~ /Opera 3\.5/o ||

Tags: miscperl, pm, vadvs
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments