File: 41filters.t

package info (click to toggle)
libhttp-proxy-perl 0.304-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 720 kB
  • sloc: perl: 2,576; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 453 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More tests => 2;
use HTTP::Proxy;
use HTTP::Proxy::HeaderFilter;
use HTTP::Proxy::BodyFilter;

my $proxy = HTTP::Proxy->new( port => 0 );

my $filter = HTTP::Proxy::HeaderFilter->new;
$proxy->push_filter( request => $filter );
is( $filter->proxy, $proxy, "The HeaderFilter knows its proxy" );

$filter = HTTP::Proxy::BodyFilter->new;
$proxy->push_filter( response => $filter );
is( $filter->proxy, $proxy, "The BodyFilter knows its proxy" );