Memory leaks have gone, oh happy days are here again..
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index 85c4941..fc13ca9 100644 (file)
@@ -64,7 +64,6 @@ before body_parameters => sub {
 has uploads => (
   is => 'rw',
   required => 1,
-  lazy => 1,
   default => sub { {} },
 );
 
@@ -97,14 +96,16 @@ has base => (
 );
 
 has _body => (
-  is => 'rw',
-  accessor => 'body',
+  is => 'rw', clearer => '_clear_body', predicate => '_has_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',