Denis Banovic wrote:
> Hi Geoffrey!
> 
> Thanks, that works fine.
> 
> It would be interresting to know how to do this in mod_perl style!
> 
> 
> I have a Output object which captures the whole output.

sounds like you might want to consider writing a PerlOutputFilterHandler
instead.

> 
> On Destroy i'm doing something like this:
>                       
> 
>                       my @header = split(/\n/, $class->http_header);
>                       foreach (@header) {
>                                $_ =~ /^(.*?)\: (.*?)$/s;
>                               $class->{r}->headers_out->add($1,$2);                  
>           
>                       }
> 
> There is also a function where I can set the Location header.
> 
> The only problem ist, that when I put this all together, there is a
> Content-length: 0

Apache will calculate the C-L header for you, so you pretty much don't need
to worry about it.  in fact, unless you _know_ that it is messing things up
for you, just forget about it altogether.

> 
> and the redirect doesn't work. I have no Idea where this Content-length: 0 is 
> comming from, I think it's from apache.

it sounds like you are doing some funky stuff, capturing output and doing
stuff on DESTROY.  as mentioned in the pervious thread, apache will send the
headers along if you somehow pass a flush bucket along (either via a direct
API call or if your print buffer gets sufficiently large or somesuch).  so,
what you need to be careful of is printing "Location:..." after the headers
are sent, though if you are adding Location to $r->headers_out that
shouldn't be an issue (and neither should you need +ParseHeaders IIRC).

anyway, this is all kind of conjecture on my part - I can't really do much
with "redirect doesn't work" without lots more information, especially since
you can get it to work with a standard Registry setup.  so, if you suspect a
bug it is best to follow the instructions at http://perl.apache.org/bugs/,
specifically the part about creating a self-contained Apache-Test
environment as described in "Problem Description."  you may find that in
stripping down your code to create the smallest test case possible you will
figure it out.

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to