Subject: | Making Apache::Session::Wrapper understand Apache:RequestRec (patch) |
I tried to use Apache::Session::Wrapper-0.17 in my shiny new Apache 2 / mod_perl 2.0 installation, but Apache::Session::Wrapper got upset because $r is now an Apache::RequestRec, which doesn't know about header_out or err_header_out methods. Anyway, I fixed it, and here's a patch for Apache::Session::Wrapper (attached). Hope it's some use.
88c88,90
< sub { $_[0]->can('err_header_out') || $_[0]->can('header_out' ) } },
---
> sub { $_[0]->can('err_header_out')
> || $_[0]->can('header_out' )
> || $_[0]->can('headers_out') } },
618,620c620,625
< my $meth = $header_object->can('err_header_out') ? 'err_header_out' : 'header_out';
<
< $header_object->$meth( 'Set-Cookie' => $cookie );
---
> if ($header_object->can('headers_out')) {
> $header_object->headers_out->set('Cookie', $cookie);
> } else {
> my $meth = $header_object->can('err_header_out') ? 'err_header_out' : 'header_out';
> $header_object->$meth( 'Set-Cookie' => $cookie );
> }