Remove getRedirectLocation and setRedirectLocation from Session::Http

This commit is contained in:
Colin Kuskie 2010-11-22 09:28:14 -08:00
parent 8b6bbdb9f7
commit 995b04e7de
8 changed files with 33 additions and 51 deletions

View file

@ -107,20 +107,6 @@ sub getNoHeader {
return $self->{_http}{noHeader};
}
#-------------------------------------------------------------------
=head2 getRedirectLocation ( )
Return the location that was set via setRedirect
=cut
sub getRedirectLocation {
my $self = shift;
return $self->{_http}{location};
}
#-------------------------------------------------------------------
=head2 getStreamedFile ( ) {
@ -229,9 +215,7 @@ sub sendHeader {
$self->setNoHeader(1);
my %params;
if ($self->isRedirect()) {
$response->header(Location => $self->getRedirectLocation);
} else {
if (!$self->isRedirect()) {
my $cacheControl = $self->getCacheControl;
my $date = ($userId eq "1") ? HTTP::Date::time2str($self->getLastModified) : HTTP::Date::time2str();
# under these circumstances, don't allow caching
@ -407,25 +391,12 @@ 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->log->info("Redirecting to $url");
$self->setRedirectLocation($url);
$self->session->response->location($url);
$self->session->response->status($type);
$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 setStreamedFile ( ) {