From: Tomas Doran Date: Sat, 27 Dec 2008 18:08:02 +0000 (+0000) Subject: Fix C::Request disparity between _body and body accessors, TODO test now passes. X-Git-Tag: 5.8000_05~68 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=069355dabccdbb5fd15a4c7cabd7ef3b96963182;hp=6e3de58fc7d0a4302fe9791c36346839ad91fb12 Fix C::Request disparity between _body and body accessors, TODO test now passes. --- diff --git a/Changes b/Changes index d150d79..5cfa657 100644 --- a/Changes +++ b/Changes @@ -1,8 +1,8 @@ # This file documents the revision history for Perl extension Catalyst. - - Add TODO tests for calling $c->req->body from inside an overridden - prepare_action method in a plugin, as used by - Catalyst::Plugin::Server (t0m) + - Fix calling $c->req->body from inside an overridden prepare_action + method in a plugin, as used by Catalyst::Plugin::Server (t0m) + - Test for this (t0m) - Fix assignment to Catalyst::Dispatcher's preload_dispatch_types and postload_dispatch_types attributes - assigning a list should later return a listref. Fixes Catalyst::Plugin::Server. (t0m) diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index a5f144c..85c4941 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -96,8 +96,9 @@ has base => ( }, ); -has body => ( - is => 'rw' +has _body => ( + is => 'rw', + accessor => 'body', ); before body => sub { diff --git a/t/aggregate/live_engine_request_body.t b/t/aggregate/live_engine_request_body.t index 1897af3..40d7ab2 100644 --- a/t/aggregate/live_engine_request_body.t +++ b/t/aggregate/live_engine_request_body.t @@ -86,9 +86,6 @@ use HTTP::Request::Common; ok( my $response = request($request), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - TODO: { - local $TODO = 'On demand request body parsing in prepare_action broken'; - like( $response->content, qr/^[1-9]/, 'Has body' ); - } + like( $response->content, qr/^[1-9]/, 'Has body' ); }