]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/CGI/Maypole.pm
Updated patches for 2.13.
[maypole.git] / lib / CGI / Maypole.pm
index 5fd736d3e25681cd240c61d2d233252e46e0c613..6448480c16241561846d83feedcd720d265f2afd 100644 (file)
@@ -7,7 +7,7 @@ use CGI::Simple;
 use Maypole::Headers;
 use Maypole::Constants;
 
-our $VERSION = '2.11';
+our $VERSION = '2.13';
 
 __PACKAGE__->mk_accessors( qw/cgi/ );
 
@@ -54,10 +54,19 @@ Call this from your CGI script to start the Maypole application.
 
 =cut
 
-sub run 
-{
-    my $self = shift;
-    return $self->handler;
+sub run  {
+  my $self = shift;
+  my $status = $self->handler;
+  if ($status != OK) {
+    print <<EOT;
+Status: 500 Maypole application error
+Content-Type: text/html
+
+<title>Maypole application error</h1>
+<h1>Maypole application error</h1>
+EOT
+  }
+  return $status;
 }
 
 =head1 Implementation
@@ -71,9 +80,11 @@ functionality. See L<Maypole> for these:
 
 =cut
 
-sub get_request 
-{
-    shift->cgi( CGI::Simple->new );
+sub get_request {
+  my $self = shift;
+  my $request_options = $self->config->request_options || {};
+  $CGI::Simple::POST_MAX = $request_options->{POST_MAX} if ($request_options->{POST_MAX});
+  $self->cgi( CGI::Simple->new );
 }
 
 =item parse_location
@@ -92,7 +103,7 @@ sub parse_location
         $r->headers_in->set($field_name => $cgi->http($http_header));
     }
 
-    $self->preprocess_location();
+    $r->preprocess_location();
 
     my $path = $cgi->url( -absolute => 1, -path_info => 1 );
     my $loc = $cgi->url( -absolute => 1 );