init III
This commit is contained in:
24
Perl OTRS/Kernel/cpan-lib/LWP/Protocol/loopback.pm
Normal file
24
Perl OTRS/Kernel/cpan-lib/LWP/Protocol/loopback.pm
Normal file
@@ -0,0 +1,24 @@
|
||||
package LWP::Protocol::loopback;
|
||||
$LWP::Protocol::loopback::VERSION = '6.26';
|
||||
use strict;
|
||||
require HTTP::Response;
|
||||
|
||||
use base qw(LWP::Protocol);
|
||||
|
||||
sub request {
|
||||
my($self, $request, $proxy, $arg, $size, $timeout) = @_;
|
||||
|
||||
my $response = HTTP::Response->new(200, "OK");
|
||||
$response->content_type("message/http; msgtype=request");
|
||||
|
||||
$response->header("Via", "loopback/1.0 $proxy")
|
||||
if $proxy;
|
||||
|
||||
$response->header("X-Arg", $arg);
|
||||
$response->header("X-Read-Size", $size);
|
||||
$response->header("X-Timeout", $timeout);
|
||||
|
||||
return $self->collect_once($arg, $response, $request->as_string);
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user