From: Aaron Trevena Date: Thu, 17 Apr 2008 19:45:57 +0000 (+0000) Subject: fix to redirect request X-Git-Tag: 2.13~8 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=ed2bc6057ed94ae64e5b03ff28477fcbac52f4ee fix to redirect request git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@584 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 3ea2d28..20046a6 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -197,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}) { @@ -218,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; } diff --git a/lib/Maypole.pm b/lib/Maypole.pm index fd39cfa..1a86f53 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -616,7 +616,7 @@ my %filetypes = ( sub __get_mime_type { my $self = shift; my $type = 'text/html'; - if ($self->path =~ m/.*\.(\w{3,4})$/) { + if ($self->path =~ m/.*\.(\w{2,4})$/) { $type = $filetypes{$1}; } else { my $output = $self->output;