X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FCGI%2FMaypole.pm;h=df75712ac261c52c1dac43228de2d88e4dc48207;hb=50801f50404838954238fb4a87d4df5dda50cd76;hp=4724a1b532d64625de4bcd3b8ba8c8759a2de731;hpb=6cd7a25572c93242146d8d8ce0eb3f2bbb76917e;p=maypole.git diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index 4724a1b..df75712 100644 --- a/lib/CGI/Maypole.pm +++ b/lib/CGI/Maypole.pm @@ -7,7 +7,7 @@ use CGI::Simple; use Maypole::Headers; use Maypole::Constants; -our $VERSION = '2.11'; +our $VERSION = '2.12'; __PACKAGE__->mk_accessors( qw/cgi/ ); @@ -71,9 +71,11 @@ functionality. See L 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,12 +94,18 @@ sub parse_location $r->headers_in->set($field_name => $cgi->http($http_header)); } + $r->preprocess_location(); + my $path = $cgi->url( -absolute => 1, -path_info => 1 ); my $loc = $cgi->url( -absolute => 1 ); { no warnings 'uninitialized'; $path .= '/' if $path eq $loc; - $path =~ s/^($loc)?\///; + if ($loc =~ /\/$/) { + $path =~ s/^($loc)?//; + } else { + $path =~ s/^($loc)?\///; + } } $r->path($path);