On Fri, Apr 27, 2007 at 02:03:23PM +0100, Simon Wilcox wrote:
> So, what do people do - do you send 303/307's "correctly" or just default
> to 302 behaviour ?

I use something like this, although you might want to customize:

sub post_redirect {
    my ( $c, $location ) = @_;
    my ($version) = $c->request->protocol =~ m/(\d+\.\d+)/;

    # Make location absolute
    $location = $c->uri_for( $location )
        unless $location =~ /http/;

    $c->res->redirect( $location, ( $version && $version > 1.0 ? 303 : 302 ));
}

One change would be to pass a comment that gets stuffed into the
session (flash).



-- 
Bill Moseley
[EMAIL PROTECTED]


_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to