X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=f2280996b2756428d9eb18b7407ee558ce32e135;hb=d91474f509dab7dce4c3e4328e674ab9fea29284;hp=a5f144c32c84985982788fd856f0a3fe92a3ac52;hpb=4a7fb2bb079028e197412336abb4a856cbacd6fb;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index a5f144c..f228099 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -96,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',