return $c;
}
-# 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.
-sub prepare_action {
- my $c = shift;
- $c->res->header('X-Have-Request-Body', 1) if $c->req->body;
- $c->next::method(@_);
-}
1;
--- /dev/null
+package Catalyst::TraitFor::Context::TestPluginServer;
+
+use Moose::Role;
+
+# 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.
+
+after prepare_action => sub {
+ my $c = shift;
+ $c->res->header('X-Have-Request-Body', 1) if $c->req->body;
+};
+
+1;
package TestApp::Context;
use Moose;
extends 'Catalyst::Context';
-with 'Catalyst::TraitFor::Context::TestHeaders';
-with 'Catalyst::TraitFor::Context::TestErrors';
+with 'Catalyst::TraitFor::Context::TestHeaders',
+ 'Catalyst::TraitFor::Context::TestErrors',
+ 'Catalyst::TraitFor::Context::TestPluginServer';
if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
with 'CatalystX::LeakChecker';