Commit | Line | Data |
dd4e6fd2 |
1 | package Catalyst::Plugin::Test::Headers; |
2 | |
3 | use strict; |
4 | |
5 | sub 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 | |
27 | sub prepare_action { |
28 | my $c = shift; |
29 | $c->NEXT::prepare_action(@_); |
30 | $c->res->header( 'X-Catalyst-Action' => $c->req->action ); |
31 | } |
32 | |
33 | 1; |