line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CatalystX::Debug::ResponseHeaders; |
2
|
1
|
|
|
1
|
|
1498
|
use Moose::Role; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use namespace::autoclean; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
requires qw/ |
8
|
|
|
|
|
|
|
log_response_headers |
9
|
|
|
|
|
|
|
log_response_status_line |
10
|
|
|
|
|
|
|
/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
around log_response_status_line => sub {}; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
around log_response_headers => sub { |
15
|
|
|
|
|
|
|
my ($orig, $c, $headers) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$c->log_headers('response', $headers); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
/; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 BUGS |
50
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Copyright 2010 the above author(s). |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This sofware is free software, and is licensed under the same terms as perl itself. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |