[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with sending custom headers in mod_perl2


Someone (you know who you are, thanks!) helped me off-list by pointing out that I should use HTTP status 301 with Location header instead. In retrospect, it should have been obvious that the behavior I desired is meaningless in the context of Refresh header. D'oh.

Victor Danilchenko wrote:
Perrin Harkins wrote:
On 5/2/07, Victor Danilchenko <suppressed> wrote:
        I seem to be missing something very obvious... I have:

$r->header_out("Refresh"=>"0; URL=$uri\n");

I think you're looking for this:

$r->headers_out->add("Refresh"=>"0; URL=$uri\n");

    Yup, that was it. Thanks.

Unfortunately, it worked, but it didn't help :(. Apparently neither Firefox nor IE honor the Refresh HTTP header when performing the XMLHttpRequest operation in JavaScript, so I will have to figure out a different way to re-process the request upon error.

You were trying to use mod_perl 1 syntax.  See this for more:
http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_header_out_




Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.