"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/lib/LWP/Protocol/nogo.pm" (26 Nov 2019, 610 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 "nogo.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::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 
    8 use strict;
    9 
   10 our $VERSION = '6.43';
   11 
   12 require HTTP::Response;
   13 require HTTP::Status;
   14 use base qw(LWP::Protocol);
   15 
   16 sub request {
   17     my($self, $request) = @_;
   18     my $scheme = $request->uri->scheme;
   19 
   20     return HTTP::Response->new(
   21       HTTP::Status::RC_INTERNAL_SERVER_ERROR,
   22       "Access to \'$scheme\' URIs has been disabled"
   23     );
   24 }
   25 1;