line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
|
|
|
|
$LWP::Protocol::nogo::VERSION = '6.29'; |
8
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require HTTP::Response; |
11
|
|
|
|
|
|
|
require HTTP::Status; |
12
|
1
|
|
|
1
|
|
5
|
use base qw(LWP::Protocol); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
133
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub request { |
15
|
1
|
|
|
1
|
1
|
2
|
my($self, $request) = @_; |
16
|
1
|
|
|
|
|
4
|
my $scheme = $request->uri->scheme; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
24
|
return HTTP::Response->new( |
19
|
|
|
|
|
|
|
HTTP::Status::RC_INTERNAL_SERVER_ERROR, |
20
|
|
|
|
|
|
|
"Access to \'$scheme\' URIs has been disabled" |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
1; |