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=f2280996b2756428d9eb18b7407ee558ce32e135;hp=85c4941c790315854625befd580e4e72c39ceca9;hb=610bc6eccd3d749c9e14422575c3b8787f48fcf1;hpb=069355dabccdbb5fd15a4c7cabd7ef3b96963182 diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 85c4941..f228099 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -98,13 +98,15 @@ has base => ( has _body => ( is => 'rw', - accessor => 'body', ); - -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',