Good afternoon,

I've got a reproducible problem preventing me from upgrading from Mason 1.28 to a newer version. I've checked all the CHANGELOG stuff and trolled through the mailing list archives, but haven't found enlightenment.

I've narrowed it down to the following test case:

- - - - - - - - - -

<%flags>
inherit => undef
</%flags>
<html>
<head>
<title>Test</title>
</head>
<body>
<&| .Foo &>
<& .Bar &>
</&>
</body>
</html>

<%def .Foo><% $m->content %></%def>

<%def .Bar>
<%init>

$m->redirect("http://google.com/");

</%init>
</%def>

- - - - - - - - -

The redirect doesn't work. The problem seems that the headers are sent/flushed earlier than they should be -- I get two sets of 200 OK response headers from the server, with a redirect link in the body of the returned page.

The code above works fine and completely as expected under Mason 1.28. It fails under Mason 1.29_01 or newer, but a bunch of stuff got changed there so I'm not even sure where to start looking.

Any ideas/thoughts?

Of note, if you change the call to Foo to read:


<&| .Foo &>
% $m->redirect("http://google.com/");
</&>

Then it works fine, as expected, with only the one set of (proper) headers. I can only produce the bug with a $m->redirect() call within a component within a component-with-content call.

Also (if this helps) changing the line in .Bar from:

$m->redirect("http://google.com/");

to:

$m->clear_buffer();
$m->abort(500);

Also produces a multiple-header scenario under Mason 1.29_01 or newer, but not under 1.28.

Cheers,


-Michael


_______________________________________________________

Michael Burns
Cosbit Technologies
403-701-2672  / [EMAIL PROTECTED]

AIM: cmikeburns
MSN: cmikeburns
_______________________________________________________

Box 2173, Station M    Calgary, Alberta, Canada    T2P 2M4

Reply via email to