Add a method to directly set the redirect location.
This commit is contained in:
parent
70fd60698c
commit
5e4e31380f
1 changed files with 14 additions and 1 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue