Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv23059/lib/HTTP/WebTest/Plugin
Modified Files:
DefaultReport.pm
Log Message:
Added report parameter show_headers
Index: DefaultReport.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/DefaultReport.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultReport.pm 2 Feb 2002 04:08:19 -0000 1.3
--- DefaultReport.pm 12 Feb 2002 12:47:10 -0000 1.4
***************
*** 51,54 ****
--- 51,66 ----
Name associated with this url in the test report and error messages.
+ =head2 show_headers
+
+ Include request and response headers in the test report.
+
+ =head3 Allowed values
+
+ C<yes>, C<no>
+
+ =head3 Default value
+
+ C<no>
+
=head2 show_html
***************
*** 107,110 ****
--- 119,123 ----
show_html yesno
show_cookies yesno
+ show_headers yesno
terse scalar('^(?:no|summary|failed_only)$') );
}
***************
*** 133,137 ****
return unless $self->global_yesno_test_param('default_report', 1);
! $self->validate_params(qw(test_name show_html
show_cookies terse));
--- 146,150 ----
return unless $self->global_yesno_test_param('default_report', 1);
! $self->validate_params(qw(test_name show_html show_headers
show_cookies terse));
***************
*** 140,143 ****
--- 153,157 ----
my $show_html = $self->yesno_test_param('show_html');
my $show_cookies = $self->yesno_test_param('show_cookies');
+ my $show_headers = $self->yesno_test_param('show_headers');
my $terse = lc $self->test_param('terse');
***************
*** 185,190 ****
my $request = $self->webtest->last_request;
if($show_cookies) {
! # sent and recieved cookies
my @sent = $request->header('Cookie');
--- 199,217 ----
my $request = $self->webtest->last_request;
+ if($show_headers) {
+ # show all headers
+
+ $out .= "\n";
+
+ $out .= " REQUEST HEADERS:\n";
+ $out .= $request->method . ' ' . $request->uri . "\n";
+ $out .= $request->headers_as_string . "\n";
+ $out .= " RESPONSE HEADERS:\n";
+ $out .= $response->protocol . " " . $response->status_line . "\n";
+ $out .= $response->headers_as_string . "\n";
+ }
+
if($show_cookies) {
! # show sent and recieved cookies
my @sent = $request->header('Cookie');
|