Make request->body fail when used as a writer.
Florian Ragwitz [Mon, 9 Nov 2009 22:21:19 +0000 (22:21 +0000)]
lib/Catalyst/Request.pm

index 30d7be4..9c9705e 100644 (file)
@@ -110,7 +110,7 @@ has _body => (
 sub body {
   my $self = shift;
   $self->_context->prepare_body();
-  $self->_body(@_) if scalar @_;
+  croak 'body is a reader' if scalar @_;
   return blessed $self->_body ? $self->_body->body : $self->_body;
 }