source: main/trunk/greenstone2/perllib/cpan/LWP/Protocol/nogo.pm@ 27183

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: 630 bytes
Line 
1package LWP::Protocol::nogo;
2# If you want to disable access to a particular scheme, use this
3# class and then call
4# LWP::Protocol::implementor(that_scheme, 'LWP::Protocol::nogo');
5# For then on, attempts to access URLs with that scheme will generate
6# a 500 error.
7
8use strict;
9use vars qw(@ISA);
10require HTTP::Response;
11require HTTP::Status;
12require LWP::Protocol;
13@ISA = qw(LWP::Protocol);
14
15sub request {
16 my($self, $request) = @_;
17 my $scheme = $request->uri->scheme;
18
19 return HTTP::Response->new(
20 &HTTP::Status::RC_INTERNAL_SERVER_ERROR,
21 "Access to \'$scheme\' URIs has been disabled"
22 );
23}
241;
Note: See TracBrowser for help on using the repository browser.