Re: Re: Forward-page ugliness solved (patch from Martin Ertl)

Joel Palmius <[email protected]>
Newsgroups gmane.comp.apache.mod-survey.general
Message-ID <[email protected]>
Ok, now I have implemented a change which should ideally work. In 
Submit.pm:

use mod_perl;
use constant MP2 => $mod_perl::VERSION < 1.99 ? 0 : 1;

...

     if(MP2)
     {
       $doc->{HANDLER}->headers_out->set('Location' => $redirectUrl);
       $doc->{HANDLER}->status(REDIRECT);
     }
     else
     {
       print "Location: $redirectUrl\n\n";
     }

I hope this works. It does under apache2 at least. I'll install apache1 
this afternoon so I have a test environment myself.

This is in CVS, so please test.

   // Joel


On Wed, 13 Oct 2004, Joel Palmius wrote:

> The problem with that is that it doesn't work on Apache2, depending on the 
> setting of PerlSendHeader, which is needed for cookies to work properly 
> (again under apache2). When doing this replace, the page forwarding stops 
> working for me.
>
> Perhaps there should be an if statement here deciding which style to use 
> depending on apache version and/or setting of PerlSendHeader.
>
> I'll look into it.
>
>  // Joel
>
>
> On Wed, 13 Oct 2004, Martin Ertl wrote:
>
>> There seems to be a problem with "headers_out()" on Apache 1
>> (at least here on the testserver)
>> 
>> The following solved this problem:
>> (it looks ugly, but it works on the testserver)
>> 
>> Replace in Submit.pm, line 250:
>> $doc->{HANDLER}->headers_out->set('Location' => $redirectUrl);
>> $doc->{HANDLER}->status(REDIRECT);
>> 
>> with:
>> print "Location: $redirectUrl\n\n";
>> 
>> 
>> 
>> Skickat av Martin Ertl <[email protected]>
>> till survey-discussion
>> 
> Skickat av Joel Palmius <[email protected]>
> till survey-discussion
>
Skickat av Joel Palmius <[email protected]>
till survey-discussion
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.