From: Tomas Doran Date: Sun, 28 Mar 2010 18:36:13 +0000 (+0100) Subject: Missed bits X-Git-Tag: 0.001 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalystX-Debug-ResponseHeaders.git;a=commitdiff_plain;h=943c9be462f18c7be2d1617257f8086e2fc5d92a Missed bits --- diff --git a/Makefile.PL b/Makefile.PL index d80949a..5c21263 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,7 +19,7 @@ author_requires 'Test::Pod' => '1.14'; author_tests 't/author'; -resources repository => 'git://somewhere.com/myproject.git'; +resources repository => 'git://github.com/bobtfish/CatalystX-Debug-ResponseHeaders.git'; if ($Module::Install::AUTHOR) { system("pod2text lib/CatalystX/Debug/ResponseHeaders.pm > README") diff --git a/README b/README index e69de29..bd650e7 100644 --- a/README +++ b/README @@ -0,0 +1,37 @@ +NAME + CatalystX::Debug::ResponseHeaders - Log the full response headers sent + by your Catalyst application in debug mode + +SYNOPSIS + use Catalyst qw/ + +CatalystX::Debug::ResponseHeaders + /; + +DESCRIPTION + Prints a Text::SimpleTable style table containing all the headers sent + from the user's browser to the application for each request when the + application is in debug mode. + +METHODS + log_response_status_line + Thie method is wrapped to stop the normal method being called. This + suppresses the normal single line response status output. + + log_response_headers + This hook method in Catalyst is wrapped to call the "log_headers" in + Catalyst method for the request headers. + +BUGS + None known, but there probably are some. + + Patches are welcome, as are bug reports in the rt.cpan.org bug tracker. + +AUTHOR + Tomas Doran (t0m) "". + +COPYRIGHT & LICENSE + Copyright 2010 the above author(s). + + This sofware is free software, and is licensed under the same terms as + perl itself. + diff --git a/lib/CatalystX/Debug/ResponseHeaders.pm b/lib/CatalystX/Debug/ResponseHeaders.pm index 5dcba39..530f695 100644 --- a/lib/CatalystX/Debug/ResponseHeaders.pm +++ b/lib/CatalystX/Debug/ResponseHeaders.pm @@ -1,41 +1,65 @@ package CatalystX::Debug::ResponseHeaders; -use Moose; +use Moose::Role; use namespace::autoclean; our $VERSION = '0.001'; -requires 'log_response_headers'; +requires qw/ + log_response_headers + log_response_status_line +/; -around log_response_headers => sub { - my $orig = shift; - my $c = shift; - my $headers = shift; # an HTTP::Headers instance +around log_response_status_line => sub {}; - return unless $c->debug; +around log_response_headers => sub { + my ($orig, $c, $headers) = @_; $c->log_headers('response', $headers); }; - 1; =head1 NAME -CatalystX::Debug::ResponseHeaders - +CatalystX::Debug::ResponseHeaders - Log the full response headers sent by your Catalyst application in debug mode + +=head1 SYNOPSIS + + use Catalyst qw/ + +CatalystX::Debug::ResponseHeaders + /; =head1 DESCRIPTION +Prints a L style table containing all the headers sent from the +user's browser to the application for each request when the application is in debug mode. + =head1 METHODS +=head2 log_response_status_line + +Thie method is wrapped to stop the normal method being called. This suppresses the +normal single line response status output. + +=head2 log_response_headers + +This hook method in L is wrapped to call the L method +for the request headers. + =head1 BUGS +None known, but there probably are some. + +Patches are welcome, as are bug reports in the L bug tracker. + =head1 AUTHOR +Tomas Doran (t0m) C<< >>. + =head1 COPYRIGHT & LICENSE -Copyright 2009 the above author(s). +Copyright 2010 the above author(s). This sofware is free software, and is licensed under the same terms as perl itself. =cut -