File Coverage

blib/lib/HTTP/Proxy/BodyFilter/tags.pm
Criterion Covered Total %
statement 19 19 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package HTTP::Proxy::BodyFilter::tags;
2             $HTTP::Proxy::BodyFilter::tags::VERSION = '0.303';
3 4     4   14326 use strict;
  4         6  
  4         104  
4 4     4   15 use Carp;
  4         5  
  4         185  
5 4     4   842 use HTTP::Proxy::BodyFilter;
  4         4  
  4         75  
6 4     4   14 use vars qw( @ISA );
  4         3  
  4         391  
7             @ISA = qw( HTTP::Proxy::BodyFilter );
8              
9             sub filter {
10 11     11 1 4935 my ( $self, $dataref, $message, $protocol, $buffer ) = @_;
11 11 100       28 return if not defined $buffer; # last "tags"
12              
13 10         16 my $idx = rindex( $$dataref, '<' );
14 10 100       27 if ( $idx > rindex( $$dataref, '>' ) ) {
15 3         8 $$buffer = substr( $$dataref, $idx );
16 3         8 $$dataref = substr( $$dataref, 0, $idx );
17             }
18             }
19              
20 3     3 1 4 sub will_modify { 0 }
21              
22             1;
23              
24             __END__