On 1/11/07, Phil Whelan <[EMAIL PROTECTED]> wrote:
Hi Marc,

Do you have a example of the configuration and code you are using?

Cheers,
Phil

Sure,

Here's the code :

--------------------------------------------------
 sub input : FilterConnectionHandler {

my $s = Apache2::ServerUtil->server;


     #my $cookie_header = $f->r->headers_in->{Cookie};
     #warn("cookie : $cookie_header");
     $s->log_error("server: log_error");
     while ($f->read(my $buffer, BUFF_LEN)) {
         $s->log_error("server: '$buffer'");

         if ($buffer =~ '^Cookie.*') {
             my $origcookies = $buffer;
           chomp($origcookies);
           $origcookies = trim($origcookies);
           my @firstsplit = split(/:/,$origcookies);
           my $cookies = $firstsplit[1];
           warn("Cookie values : $cookies");
           my $newcookies = rename_cookies($cookies);
           $f->print("Cookie: $newcookies \r\n");
         } else {
            $f->print(lc $buffer);
         }
     }
     Apache2::Const::OK;
}
-------------------------------------------------------------------------------

here's my config:

------------------------------------------------------------------------------
<VirtualHost *>
#PerlModule Apache::Proxy::MyProxy;
#SetEnv proxy-nokeepalive 1
#<Location /rocks>
     #SetHandler perl-script
     #PerlOptions +ParseHeaders
     PerlModule XXX::InboundCookieFilter
      PerlInputFilterHandler XXX::InboundCookieFilter::input
#      PerlOutputFilterHAndler XXX::OutboundCookieFilter
#      ProxyPass / http://localhost:8080/
#      PerlResponseHandler  MyApache2::MyProxy
#</Location>
</VirtualHost>
---------------------------------------------------------------------------------

Thanks!

Reply via email to