Michael Lackhoff wrote:
> Hello,
> 
> I came across a bug in CAP::Dispatch when trying to set a header under 
> mod_perl 2. It looks like the caching goes a little bit too far, so 
> that the apache request object ($r) is also cached which leads to some 
> unexpected results, e.g. when setting headers through the request 
> object.
> 
> As a quick fix I changed Dispatch.pm like this (around line 258):
> if ( my $final_args = $self->_url_cache() ) {
>         if ($args{args_to_new}{PARAMS}{r}) {
>             $final_args->[2]{PARAMS}{r} = 
> $args{args_to_new}{PARAMS}{r}; 
>         }

You are correct. I've fixed this and uploaded a new version to CPAN.

> By the way -- shouldn't CAPs header_add and friends handle the setting 
> of headers, no matter what the environment? At the moment I have to 
> test if I am running as normal CGI or under mod_perl2 (I think under 
> mod_perl1 it is still possible to just 'print' headers like in CGI).
> No big deal, really but perhaps something for the next version.

It just used CGI.pm's header methods. But I thought those were using mod_perl
behind the scenes if it's available. From CGI.pm (at the end of the header() 
method)

    if ($MOD_PERL and not $nph) {
        $self->r->send_cgi_header($header);
        return '';
    }

-- 
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to