line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::HTTP::UA::Mojo::Proxy; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
5
|
2
|
|
|
2
|
|
40
|
use 5.016; |
|
2
|
|
|
|
|
7
|
|
6
|
2
|
|
|
2
|
|
12
|
use Mojo::Base 'Mojo::UserAgent::Proxy'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
27
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Proxy class for Test2::Tools::HTTP::UA::Mojo |
9
|
|
|
|
|
|
|
our $VERSION = '0.05'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'apps'; |
13
|
|
|
|
|
|
|
has 'apps_proxy_url'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub prepare |
16
|
|
|
|
|
|
|
{ |
17
|
17
|
|
|
17
|
1
|
12760
|
my ($self, $tx) = @_; |
18
|
|
|
|
|
|
|
|
19
|
17
|
100
|
|
|
|
51
|
if($self->apps->uri_to_app($tx->req->url."")) |
20
|
|
|
|
|
|
|
{ |
21
|
2
|
|
|
|
|
610
|
$tx->req->proxy($self->apps_proxy_url); |
22
|
2
|
|
|
|
|
24
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else |
25
|
|
|
|
|
|
|
{ |
26
|
15
|
|
|
|
|
6455
|
return $self->SUPER::prepare($tx); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |