diff options
Diffstat (limited to 'Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm')
-rw-r--r-- | Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm b/Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm index db6c0bfba9d..e6fe5ce8473 100644 --- a/Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm +++ b/Master/tlpkg/tlperl/site/lib/LWP/Protocol/gopher.pm @@ -1,5 +1,5 @@ package LWP::Protocol::gopher; - +$LWP::Protocol::gopher::VERSION = '6.25'; # Implementation of the gopher protocol (RFC 1436) # # This code is based on 'wwwgopher.pl,v 0.10 1994/10/17 18:12:34 shelden' @@ -8,15 +8,13 @@ package LWP::Protocol::gopher; # including contributions from Marc van Heyningen and Martijn Koster. use strict; -use vars qw(@ISA); require HTTP::Response; require HTTP::Status; require IO::Socket; require IO::Select; -require LWP::Protocol; -@ISA = qw(LWP::Protocol); +use base qw(LWP::Protocol); my %gopher2mimetype = ( @@ -47,7 +45,7 @@ sub request # check proxy if (defined $proxy) { - return HTTP::Response->new(&HTTP::Status::RC_BAD_REQUEST, + return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy through the gopher'); } @@ -57,19 +55,19 @@ sub request my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD') { - return HTTP::Response->new(&HTTP::Status::RC_BAD_REQUEST, + return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'gopher:' URLs"); } my $gophertype = $url->gopher_type; unless (exists $gopher2mimetype{$gophertype}) { - return HTTP::Response->new(&HTTP::Status::RC_NOT_IMPLEMENTED, + return HTTP::Response->new(HTTP::Status::RC_NOT_IMPLEMENTED, 'Library does not support gophertype ' . $gophertype); } - my $response = HTTP::Response->new(&HTTP::Status::RC_OK, "OK"); + my $response = HTTP::Response->new(HTTP::Status::RC_OK, "OK"); $response->header('Content-type' => $gopher2mimetype{$gophertype} || 'text/plain'); $response->header('Content-Encoding' => $gopher2encoding{$gophertype}) @@ -80,7 +78,7 @@ sub request $response->header('Client-Warning' => 'Client answer only'); return $response; } - + if ($gophertype eq '7' && ! $url->search) { # the url is the prompt for a gopher search; supply boiler-plate return $self->collect_once($arg, $response, <<"EOT"); |