[Catalyst] Has $c->response->redirect behaviour changed?

Alex Kavanagh alex at tinwood.homelinux.org
Tue Jan 24 19:37:35 CET 2006


At Tue, 24 Jan 2006 12:42:12 +0000,
Chisel Wright wrote:
> 
> On Tue, Jan 24, 2006 at 11:19:18AM +0000, Chisel Wright wrote:
> > I'm sure it's something daft that I've done.
> 
> Or not done.
> 
> Basically I've got MyApp::App::Helper::login_if_required() which does
> ->redirect(...) if someone's not logged in.
> 
> For some reason I've been thinking that ->redirect() is magical in some
> way, and once issued it does the HTTP redirect immediately.
> Not true.

I did too until I looked at the code and saw that it only changed the
status accessor on the response object.  

I've ended up using the DefaultEnd plugin which has the check in it
for a 3xx status and doesn't call the view if that is the case.  I do
wonder whether this should be in the core code ... any way it works
now.

-- 
Alex



More information about the Catalyst mailing list