package Test::Filter; use strict; use warnings; use Apache2::Filter (); use Apache2::RequestRec (); use Apache2::Const -compile => qw(OK DECLINED); sub handler { my $f = shift; my $r = $f->r; my $content_type = $r->content_type(); my $handler = $r->handler; my $encoding = $r->content_encoding(); unless (defined ($content_type)) {$content_type =0} unless (defined ($handler)) {$handler =0} unless (defined ($encoding)) {$encoding =0} open (LOGG, ">>", "/path/to/log"); print LOGG "Encoding: $encoding \nContent: $content_type \nHandler: $handler \n"; close LOGG; while ($f->read(my $buffer, 1024)) { $buffer =~ s!(
)!$1