Commit | Line | Data |
019a8a6a |
1 | package CatalystX::Debug::ResponseHeaders; |
943c9be4 |
2 | use Moose::Role; |
019a8a6a |
3 | use namespace::autoclean; |
4 | |
1089fa72 |
5 | our $VERSION = '0.002'; |
019a8a6a |
6 | |
943c9be4 |
7 | requires qw/ |
8 | log_response_headers |
9 | log_response_status_line |
10 | /; |
019a8a6a |
11 | |
943c9be4 |
12 | around log_response_status_line => sub {}; |
019a8a6a |
13 | |
943c9be4 |
14 | around log_response_headers => sub { |
15 | my ($orig, $c, $headers) = @_; |
019a8a6a |
16 | |
17 | $c->log_headers('response', $headers); |
18 | }; |
19 | |
019a8a6a |
20 | 1; |
21 | |
22 | =head1 NAME |
23 | |
943c9be4 |
24 | CatalystX::Debug::ResponseHeaders - Log the full response headers sent by your Catalyst application in debug mode |
25 | |
26 | =head1 SYNOPSIS |
27 | |
28 | use Catalyst qw/ |
29 | +CatalystX::Debug::ResponseHeaders |
30 | /; |
019a8a6a |
31 | |
32 | =head1 DESCRIPTION |
33 | |
943c9be4 |
34 | Prints a L<Text::SimpleTable> style table containing all the headers sent from the |
35 | user's browser to the application for each request when the application is in debug mode. |
36 | |
019a8a6a |
37 | =head1 METHODS |
38 | |
943c9be4 |
39 | =head2 log_response_status_line |
40 | |
41 | Thie method is wrapped to stop the normal method being called. This suppresses the |
42 | normal single line response status output. |
43 | |
44 | =head2 log_response_headers |
45 | |
46 | This hook method in L<Catalyst> is wrapped to call the L<Catalyst/log_headers> method |
47 | for the request headers. |
48 | |
019a8a6a |
49 | =head1 BUGS |
50 | |
943c9be4 |
51 | None known, but there probably are some. |
52 | |
53 | Patches are welcome, as are bug reports in the L<rt.cpan.org> bug tracker. |
54 | |
019a8a6a |
55 | =head1 AUTHOR |
56 | |
943c9be4 |
57 | Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>. |
58 | |
019a8a6a |
59 | =head1 COPYRIGHT & LICENSE |
60 | |
943c9be4 |
61 | Copyright 2010 the above author(s). |
019a8a6a |
62 | |
63 | This sofware is free software, and is licensed under the same terms as perl itself. |
64 | |
65 | =cut |