Changelog, new version
[catagits/CatalystX-Debug-RequestHeaders.git] / lib / CatalystX / Debug / RequestHeaders.pm
CommitLineData
4b9bbaf9 1package CatalystX::Debug::RequestHeaders;
2ab3d8c4 2use Moose::Role;
4b9bbaf9 3use namespace::autoclean;
4
fc1c7e79 5our $VERSION = '0.002';
256ec05c 6
2ab3d8c4 7requires 'log_request_headers';
8
9around log_request_headers => sub {
10 my $orig = shift;
11 my $c = shift;
12 my $headers = shift; # an HTTP::Headers instance
13
14 return unless $c->debug;
15
16 $c->log_headers('request', $headers);
17};
18
4b9bbaf9 191;
20
21=head1 NAME
22
2ab3d8c4 23CatalystX::Debug::RequestHeaders - Log the full request headers sent to a Catalyst application in debug mode
24
25=head1 SYNOPSIS
26
27 use Catalyst qw/
28 +CatalystX::Debug::RequestHeaders
29 /;
4b9bbaf9 30
31=head1 DESCRIPTION
32
2ab3d8c4 33Prints a L<Text::SimpleTable> style table containing all the headers sent from the
34user's browser to the application for each request when the application is in debug mode.
35
4b9bbaf9 36=head1 METHODS
37
2ab3d8c4 38=head2 log_request_headers
39
40This hook method in L<Catalyst> is wrapped to call the L<Catalyst/log_headers> method
41for the request headers.
42
4b9bbaf9 43=head1 BUGS
44
2ab3d8c4 45None known, but there probably are some.
46
47Patches are welcome, as are bug reports in the L<rt.cpan.org> bug tracker.
48
4b9bbaf9 49=head1 AUTHOR
50
2ab3d8c4 51Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>.
52
4b9bbaf9 53=head1 COPYRIGHT & LICENSE
54
2ab3d8c4 55Copyright 2010 the above author(s).
4b9bbaf9 56
57This sofware is free software, and is licensed under the same terms as perl itself.
58
59=cut
60