Subject: | BodyFilter::complete does not function |
HTTP::Proxy::BodyFilter::complete does not function as advertised.
[code]#!/usr/bin/perl
use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::complete;
use HTTP::Proxy::BodyFilter::simple;
my $proxy = HTTP::Proxy->new;
$proxy->port( 3128 );
$proxy->push_filter(
mime => 'image/jpeg',
response => HTTP::Proxy::BodyFilter::complete->new,
response => HTTP::Proxy::BodyFilter::simple->new( sub { ${ $_[1] } =
'filtered!' } ),
);
$proxy->start;[/code]
Proxy starts and runs, but test download of a jpg shows that the simple
filter is being run multiple times, not just once on the entire body:
[code]# telnet localhost 3128
Trying 127.0.0.1...
Connected to localhost.redacted.com.
Escape character is '^]'.
GET http://redacted.com/test.jpg
filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!filtered!Connection
closed by foreign host.
[/code]
Also does not work if BodyFilter::complete is called in an entirely
separate push_filter invocation.