From 5e4e31380f1029be6ac526b952e4d18ed5a4c7bc Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 26 Jul 2008 02:07:31 +0000 Subject: [PATCH] Add a method to directly set the redirect location. --- lib/WebGUI/Session/Http.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Session/Http.pm b/lib/WebGUI/Session/Http.pm index cd1e5addc..7aa96e81c 100644 --- a/lib/WebGUI/Session/Http.pm +++ b/lib/WebGUI/Session/Http.pm @@ -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 )