X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;h=f4f835b67eb58472bb83e4d4f6a1050018a22b69;hb=737226235b1ca9303d321aeb0b65d96be5234d81;hp=b620c5e70047c68606648694f9ac126eb2300b2f;hpb=c057ae860545285e5812b5ba86ea992e203be773;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/Catalyst/Plugin/Test/Plugin.pm b/t/lib/Catalyst/Plugin/Test/Plugin.pm index b620c5e..f4f835b 100644 --- a/t/lib/Catalyst/Plugin/Test/Plugin.pm +++ b/t/lib/Catalyst/Plugin/Test/Plugin.pm @@ -4,7 +4,7 @@ use strict; use warnings; use MRO::Compat; -use base qw/Catalyst::Controller Class::Data::Inheritable/; +use base qw/Class::Data::Inheritable/; __PACKAGE__->mk_classdata('ran_setup'); @@ -22,26 +22,14 @@ sub prepare { return $c; } -# Note: This is horrible, but Catalyst::Plugin::Server forces the body to +# Note: Catalyst::Plugin::Server forces the body to # be parsed, by calling the $c->req->body method in prepare_action. # We need to test this, as this was broken by 5.80. See also -# t/aggregate/live_engine_request_body.t. Better ways to test this -# appreciated if you have suggestions :) -{ - my $have_req_body = 0; - sub prepare_action { - my $c = shift; - $have_req_body++ if $c->req->body; - $c->next::method(@_); - } - sub have_req_body_in_prepare_action : Local { - my ($self, $c) = @_; - $c->res->body($have_req_body); - } -} - -sub end : Private { - my ($self,$c) = @_; +# t/aggregate/live_engine_request_body.t. +sub prepare_action { + my $c = shift; + $c->res->header('X-Have-Request-Body', 1) if $c->req->body; + $c->next::method(@_); } 1;