| 15/38 |
© 2004 by Philippe "BooK" Bruhat.
|
This is the base class for manipulating message headers
The filter() method has the following signature:
sub filter { my ( $self, $headers, $message ) = @_; ... }
The filter can create a response and make the proxy send it directly
by using the proxy response() accessor.
$filter = HTTP::Proxy::HeaderFilter::simple->new( sub { my ( $self, $headers, $message ) = @_; # random error $self->proxy->response( HTTP::Response->new( 403, "<h1>Nothing to see here, move along.</h1>", [ 'Content-Type' => 'text/html' ] ) ) if rand > .7; } );
This completely shortcuts the origin server