source: main/trunk/greenstone2/perllib/cpan/LWP/Protocol/loopback.pm@ 27183

Last change on this file since 27183 was 27183, checked in by davidb, 11 years ago

Changing to using installed version of LWP that comes from libwww-perl, which is more self-contained than v6.x

File size: 601 bytes
Line 
1package LWP::Protocol::loopback;
2
3use strict;
4use vars qw(@ISA);
5require HTTP::Response;
6
7require LWP::Protocol;
8@ISA = qw(LWP::Protocol);
9
10sub request {
11 my($self, $request, $proxy, $arg, $size, $timeout) = @_;
12
13 my $response = HTTP::Response->new(200, "OK");
14 $response->content_type("message/http; msgtype=request");
15
16 $response->header("Via", "loopback/1.0 $proxy")
17 if $proxy;
18
19 $response->header("X-Arg", $arg);
20 $response->header("X-Read-Size", $size);
21 $response->header("X-Timeout", $timeout);
22
23 return $self->collect_once($arg, $response, $request->as_string);
24}
25
261;
Note: See TracBrowser for help on using the repository browser.