Renaming all the attributes, as making them _private breaks multiple plugins. See...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index a5f144c..f228099 100644 (file)
@@ -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',