Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv11536/lib/HTTP/WebTest/Recorder
Modified Files:
Controller.pm
Log Message:
Support raw response made by actions
Index: Controller.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Controller.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Controller.pm 1 Feb 2003 22:40:07 -0000 1.4
--- Controller.pm 2 Feb 2003 00:00:18 -0000 1.5
***************
*** 34,42 ****
use vars qw(%DISPATCH);
! %DISPATCH = (list => \&list_action,
! request => \&request_action,
! wtscript => \&wtscript_action,
! enable => \&enable_action,
! default => \&default_action);
# serves requests for web interface of the proxy
--- 34,43 ----
use vars qw(%DISPATCH);
! %DISPATCH = (list => \&list_action,
! request => \&request_action,
! response_content => \&response_content_action,
! wtscript => \&wtscript_action,
! enable => \&enable_action,
! default => \&default_action);
# serves requests for web interface of the proxy
***************
*** 61,64 ****
--- 62,69 ----
$response = HTTP::Response->new(RC_FOUND);
$response->header(Location => $@->url);
+ } elsif($@->isa('HTTP::WebTest::Recorder::Exception::RawResponse')) {
+ $response = HTTP::Response->new(RC_OK);
+ $response->header(@{$@->headers});
+ $response->content($@->content);
} else {
$@->rethrow;
***************
*** 101,104 ****
--- 106,119 ----
HTTP::WebTest::Recorder::Exception::Redirect->throw(message => 'Redirect',
url => $url);
+ }
+
+ # generates raw response exception
+ sub raw_response {
+ my $self = shift;
+ my %param = @_;
+
+ $param{message} = 'Raw Response';
+
+ HTTP::WebTest::Recorder::Exception::RawResponse->throw(%param);
}
|