Commit | Line | Data |
dd4e6fd2 |
1 | package Catalyst::Plugin::Test::Headers; |
2 | |
3 | use strict; |
951bab6b |
4 | use MRO::Compat; |
dd4e6fd2 |
5 | |
6 | sub prepare { |
7 | my $class = shift; |
8 | |
dbb2d5cd |
9 | my $c = $class->next::method(@_); |
dd4e6fd2 |
10 | |
11 | $c->response->header( 'X-Catalyst-Engine' => $c->engine ); |
12 | $c->response->header( 'X-Catalyst-Debug' => $c->debug ? 1 : 0 ); |
ac5c933b |
13 | |
dd4e6fd2 |
14 | { |
a4def412 |
15 | my $components = join( ', ', sort keys %{ $c->components } ); |
16 | $c->response->header( 'X-Catalyst-Components' => $components ); |
dd4e6fd2 |
17 | } |
18 | |
19 | { |
20 | no strict 'refs'; |
836e1134 |
21 | my $plugins = join ', ', $class->registered_plugins; |
a4def412 |
22 | $c->response->header( 'X-Catalyst-Plugins' => $plugins ); |
dd4e6fd2 |
23 | } |
24 | |
25 | return $c; |
26 | } |
27 | |
28 | sub prepare_action { |
29 | my $c = shift; |
dbb2d5cd |
30 | $c->next::method(@_); |
dd4e6fd2 |
31 | $c->res->header( 'X-Catalyst-Action' => $c->req->action ); |
32 | } |
33 | |
34 | 1; |