1 package Catalyst::Plugin::Test::Plugin;
7 use base qw/Catalyst::Base Class::Data::Inheritable/;
9 __PACKAGE__->mk_classdata('ran_setup');
20 # Note: This use of NEXT is deliberately left here (without a use NEXT)
21 # to ensure back compat, as NEXT always used to be loaded, but
22 # is now replaced by Class::C3::Adopt::NEXT.
23 my $c = $class->NEXT::prepare(@_);
24 $c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup );
30 # Note: This is horrible, but Catalyst::Plugin::Server forces the body to
31 # be parsed, by calling the $c->req->body method in prepare_action.
32 # We need to test this, as this was broken by 5.80. See also
33 # t/aggregate/live_engine_request_body.t. Better ways to test this
34 # appreciated if you have suggestions :)
36 my $have_req_body = 0;
39 $have_req_body++ if $c->req->body;
42 sub have_req_body_in_prepare_action : Local {
44 $c->res->body($have_req_body);