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 | |
---|
1 | package LWP::Protocol::loopback;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use vars qw(@ISA);
|
---|
5 | require HTTP::Response;
|
---|
6 |
|
---|
7 | require LWP::Protocol;
|
---|
8 | @ISA = qw(LWP::Protocol);
|
---|
9 |
|
---|
10 | sub 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 |
|
---|
26 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.