PSGI improvements

Call to_app() explicitly rather than using Plack::Component's overload
Compile the psgi sub once per app, not once per req
This commit is contained in:
Patrick Donelan 2010-04-17 19:06:07 -04:00
parent ad68c7bd19
commit 9621120825
6 changed files with 66 additions and 60 deletions

View file

@ -63,6 +63,7 @@ sub AUTOLOAD {
my @args = @_;
our $AUTOLOAD;
my $method = "SUPER::".(split /::/, $AUTOLOAD)[-1];
return if $method eq 'SUPER::DESTROY';
return $self->$method(@args);
}

View file

@ -231,7 +231,8 @@ Returns a boolean value indicating whether the current page will redirect to som
sub isRedirect {
my $self = shift;
return isIn($self->getStatus(), qw(302 301));
my $status = $self->getStatus;
return $status == 302 || $status == 301;
}