"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/lib/LWP/Protocol/loopback.pm" (26 Nov 2019, 586 Bytes) of package /linux/www/libwww-perl-6.43.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "loopback.pm" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.42_vs_6.43.

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