Merged 5.49_01 (r1339) from refactored branch to trunk
[catagits/Catalyst-Runtime.git] / t / live / lib / Catalyst / Plugin / Test / Headers.pm
CommitLineData
dd4e6fd2 1package Catalyst::Plugin::Test::Headers;
2
3use strict;
4
5sub prepare {
6 my $class = shift;
7
8 my $c = $class->NEXT::prepare(@_);
9
10 $c->response->header( 'X-Catalyst-Engine' => $c->engine );
11 $c->response->header( 'X-Catalyst-Debug' => $c->debug ? 1 : 0 );
12
13 {
a4def412 14 my $components = join( ', ', sort keys %{ $c->components } );
15 $c->response->header( 'X-Catalyst-Components' => $components );
dd4e6fd2 16 }
17
18 {
19 no strict 'refs';
a4def412 20 my $plugins = join( ', ', sort grep { m/^Catalyst::Plugin/ } @{ $class . '::ISA' } );
21 $c->response->header( 'X-Catalyst-Plugins' => $plugins );
dd4e6fd2 22 }
23
24 return $c;
25}
26
27sub prepare_action {
28 my $c = shift;
29 $c->NEXT::prepare_action(@_);
30 $c->res->header( 'X-Catalyst-Action' => $c->req->action );
31}
32
331;