line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::App::Proxy::Anonymous; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Plack::App::Proxy::Anonymous - anonymous proxy requests |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=for markdown ```perl |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# In app.psgi |
12
|
|
|
|
|
|
|
use Plack::Builder; |
13
|
|
|
|
|
|
|
use Plack::App::Proxy::Anonymous; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
builder { |
16
|
|
|
|
|
|
|
enable "Proxy::Requests"; |
17
|
|
|
|
|
|
|
Plack::App::Proxy::Anonymous->new->to_app; |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=for markdown ``` |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This module extends L. It doesn't add own headers which |
25
|
|
|
|
|
|
|
could trace an origin of the request. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=for readme stop |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
2
|
|
351037
|
use 5.006; |
|
2
|
|
|
|
|
13
|
|
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
39
|
|
34
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
159
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our $VERSION = '0.0100'; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
2
|
|
470
|
use parent qw(Plack::App::Proxy); |
|
2
|
|
|
|
|
298
|
|
|
2
|
|
|
|
|
10
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub build_headers_from_env { |
41
|
0
|
|
|
0
|
0
|
|
my ($self, $env, $req) = @_; |
42
|
0
|
|
|
|
|
|
my $headers = $req->headers->clone; |
43
|
0
|
|
|
|
|
|
return +{%$headers}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |