[Catalyst-dev] Re: RFC: DWIM redirects

Jonathan Rockway jon at jrock.us
Tue Jan 9 18:16:22 GMT 2007



A. Pagaltzis wrote:
> The patch does the same as the code that’s already there: set 302
> unless you specify a 3xx status yourself.

Admittedly I made one "tricky" change here.  Before, you had to write:

$c->response->redirect(...);
$c->response->status(303);

Now you can write:

$c->response->status(303);
$c->response->redirect(...);

redirect used to trash the status code, but it doesn't anymore*.  I hope
this doesn't break anything.

* Unless the status code is not between 300 and 399.  In that case, 302
is chosen.

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;



More information about the Catalyst-dev mailing list