X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=21a26bffe3a5d53a43fa49f8138a6cb6d8474210;hp=ec7a96ade50458466c7dce37e53da3aa44cc0c3d;hb=0fc2d522eec43202c21e9f0062e43f10db4d9008;hpb=8e061fef6ed2e38808032cbb722098c5c183ec03 diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index ec7a96a..21a26bf 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -1,5 +1,6 @@ package Catalyst::Request; +use Class::C3; use IO::Socket qw[AF_INET inet_aton]; use Carp; use utf8; @@ -32,9 +33,16 @@ has headers => ( lazy => 1, ); +#Moose ToDo: +#can we lose the before modifiers which just call prepare_body ? +#they are wasteful, slow us down and feel cluttery. +# Can we call prepare_body at BUILD time? +# Can we make _body an attribute and have the rest of these lazy build from there? + has _context => ( is => 'rw', weak_ref => 1, + handles => ['read'], ); has body_parameters => ( @@ -56,10 +64,11 @@ has uploads => ( default => sub { {} }, ); -before uploads => sub { - my ($self) = @_; - #$self->_context->prepare_body; -}; +# modifier was a noop (groditi) +# before uploads => sub { +# my ($self) = @_; +# #$self->_context->prepare_body; +# }; has parameters => ( is => 'rw', @@ -436,10 +445,6 @@ defaults to the size of the request if not specified. You have to set MyApp->config->{parse_on_demand} to use this directly. -=cut - -sub read { shift->_context->read(@_); } - =head2 $req->referer Shortcut for $req->headers->referer. Returns the referring page.