X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FApache%2FMVC.pm;h=0dba642b9cdb2237fd623c5da5f8ce6f3b324246;hb=213b0e139beb727fa7ef1ba757b41a00cf8437f7;hp=a79c6113f2f4a7932cb511929ed5c354adafc1de;hpb=50801f50404838954238fb4a87d4df5dda50cd76;p=maypole.git diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index a79c611..0dba642 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -1,6 +1,6 @@ package Apache::MVC; -our $VERSION = '2.12'; +our $VERSION = '2.121'; use strict; use warnings; @@ -96,9 +96,14 @@ sub get_request { my $request_options = $self->config->request_options || {}; my $ar; if ($MODPERL2) { - $ar = eval {require Apache2::Request} ? Apache2::Request->new($r,%{$request_options}) : $r; - } - else { $ar = Apache::Request->instance($r,%{$request_options}); } + $ar = eval {require Apache2::Request} ? Apache2::Request->new($r,%{$request_options}) : $r; + } else { + if (keys %$request_options) { + $ar = Apache::Request->new($r,%{$request_options}); + } else { + $ar = Apache::Request->instance($r); + } + } $self->ar($ar); } @@ -192,8 +197,7 @@ can only be combined with status. sub redirect_request { my $r = shift; my $redirect_url = $_[0]; - my $status = $MODPERL2 ? eval 'Apache2::Const::REDIRECT;' : - eval 'Apache::Constants::REDIRECT;'; # why have to eval this? + my $status = $MODPERL2 ? eval 'Apache2::Const::REDIRECT;' : eval 'Apache::Constants::REDIRECT;'; if ($_[1]) { my %args = @_; if ($args{url}) { @@ -213,6 +217,7 @@ sub redirect_request { $r->ar->status($status); $r->ar->headers_out->set('Location' => $redirect_url); + $r->output('redirecting...

redirecting..

') unless ($r->output); return OK; }