X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=f2280996b2756428d9eb18b7407ee558ce32e135;hb=610bc6eccd3d749c9e14422575c3b8787f48fcf1;hp=48253b925a4f2b9db12714bf981ec19eb35f4ca2;hpb=025703186d05624d36984961c75a1e138eaed850;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 48253b9..f228099 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -68,12 +68,6 @@ has uploads => ( default => sub { {} }, ); -# modifier was a noop (groditi) -# before uploads => sub { -# my ($self) = @_; -# #$self->_context->prepare_body; -# }; - has parameters => ( is => 'rw', required => 1, @@ -83,7 +77,6 @@ has parameters => ( before parameters => sub { my ($self, $params) = @_; - #$self->_context->prepare_body(); if ( $params && !ref $params ) { $self->_context->log->warn( "Attempt to retrieve '$params' with req->params(), " . @@ -103,14 +96,17 @@ has base => ( }, ); -has body => ( - is => 'rw' +has _body => ( + is => 'rw', ); - -before body => sub { - my ($self) = @_; +# Eugh, ugly. Should just be able to rename accessor methods to 'body' +# and provide a custom reader.. +sub body { + my $self = shift; $self->_context->prepare_body(); -}; + $self->_body(@_) if scalar @_; + return blessed $self->_body ? $self->_body->body : $self->_body; +} has hostname => ( is => 'rw',