File Coverage

blib/lib/LWP/Protocol/loopback.pm
Criterion Covered Total %
statement 14 14 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package LWP::Protocol::loopback;
2              
3 2     2   12 use strict;
  2         4  
  2         94  
4              
5             our $VERSION = '6.34';
6              
7             require HTTP::Response;
8              
9 2     2   9 use base qw(LWP::Protocol);
  2         3  
  2         377  
10              
11             sub request {
12 13     13 1 26 my($self, $request, $proxy, $arg, $size, $timeout) = @_;
13              
14 13         34 my $response = HTTP::Response->new(200, "OK");
15 13         560 $response->content_type("message/http; msgtype=request");
16              
17 13 50       257 $response->header("Via", "loopback/1.0 $proxy")
18             if $proxy;
19              
20 13         723 $response->header("X-Arg", $arg);
21 13         684 $response->header("X-Read-Size", $size);
22 13         676 $response->header("X-Timeout", $timeout);
23              
24 13         694 return $self->collect_once($arg, $response, $request->as_string);
25             }
26              
27             1;