Add a method to directly set the redirect location.

This commit is contained in:
Colin Kuskie 2008-07-26 02:07:31 +00:00
parent 70fd60698c
commit 5e4e31380f

View file

@ -510,12 +510,25 @@ sub setRedirect {
my @params = $self->session->form->param;
return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self
$self->session->errorHandler->info("Redirecting to $url");
$self->{_http}{location} = $url;
$self->setRedirectLocation($url);
$self->setStatus("302", "Redirect");
$self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url});
}
#-------------------------------------------------------------------
=head2 setRedirectLocation ( url )
Sets the HTTP redirect URL.
=cut
sub setRedirectLocation {
my $self = shift;
$self->{_http}{location} = shift;
}
#-------------------------------------------------------------------
=head2 setStatus ( code, description )