X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=b14720dd7cd262b96b327255881fc7ea51dcfe3d;hb=38b69fcfc9f24e530622e44f4a2d685604f07e39;hp=e16dd829abc76ab7e3c6d1da9b40f0153cfc7e85;hpb=9b8f3c269605db27908000957b20cc3a336f9148;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index e16dd82..b14720d 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -5,13 +5,15 @@ use strict; use warnings; use Maypole::Config; use Maypole::Constants; +use Maypole::Headers; our $VERSION = '2.05'; __PACKAGE__->mk_classdata($_) for qw( config init_done view_object ); __PACKAGE__->mk_accessors( qw( ar params query objects model_class template_args output path - args action template error document_encoding content_type table) + args action template error document_encoding content_type table + headers_in headers_out ) ); __PACKAGE__->config( Maypole::Config->new() ); __PACKAGE__->init_done(0); @@ -61,6 +63,7 @@ sub handler { my ( $class, $req ) = @_; $class->init unless $class->init_done; my $r = bless { template_args => {}, config => $class->config }, $class; + $r->headers_out(Maypole::Headers->new); $r->get_request($req); $r->parse_location(); my $status = $r->handler_guts(); @@ -182,6 +185,7 @@ sub parse_path { shift @pi while @pi and !$pi[0]; $self->{table} = shift @pi; $self->{action} = shift @pi; + $self->{action} ||= "index"; $self->{args} = \@pi; } @@ -276,6 +280,14 @@ A list of remaining parts of the request path after table and action have been removed +=head3 headers_in + +A L object containing HTTP headers for the request + +=head3 headers_out + +A L object that contains HTTP headers for the output + =head3 parse_args Turns post data and query string paramaters into a hash of C.