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

Chisel Wright chisel at herlpacker.co.uk
Tue Jan 24 13:42:12 CET 2006


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.

So when calling MyApp::App::Helper::login_if_required() in auto(), with
no other tests, and "return 1" for the default auto() return value, I
was setting up for the redirect, returning, and auto was saying
"continue processing the chain".

What I've moved to is having login_if_required() "return" after the
redirect(), and then using this in auto() to decide if I should "return
0" or not.


A stupid mistake on my part, but I'm posting in case anyone else is
making the same mistake.

Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 



More information about the Catalyst mailing list