line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Engine::Role::RequestBuilder::Standard; |
2
|
56
|
|
|
56
|
|
37061
|
use Any::Moose '::Role'; |
|
56
|
|
|
|
|
129
|
|
|
56
|
|
|
|
|
362
|
|
3
|
|
|
|
|
|
|
|
4
|
56
|
|
|
56
|
|
50230
|
use Socket qw[AF_INET inet_aton]; |
|
56
|
|
|
|
|
37762
|
|
|
56
|
|
|
|
|
20630
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with qw(HTTP::Engine::Role::RequestBuilder); |
7
|
56
|
|
|
56
|
|
1253791
|
use CGI::Simple::Cookie (); |
|
56
|
|
|
|
|
327020
|
|
|
56
|
|
|
|
|
7913
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _build_cookies { |
10
|
2
|
|
|
2
|
|
5
|
my($self, $req) = @_; |
11
|
|
|
|
|
|
|
|
12
|
2
|
100
|
|
|
|
10
|
if (my $header = $req->header('Cookie')) { |
13
|
1
|
|
|
|
|
50
|
return { CGI::Simple::Cookie->parse($header) }; |
14
|
|
|
|
|
|
|
} else { |
15
|
1
|
|
|
|
|
92
|
return {}; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _build_hostname { |
20
|
1
|
|
|
1
|
|
3
|
my ( $self, $req ) = @_; |
21
|
1
|
|
|
|
|
8
|
gethostbyaddr( inet_aton( $req->address ), AF_INET ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# for win32 hacks |
25
|
|
|
|
|
|
|
BEGIN { |
26
|
56
|
50
|
|
56
|
|
2635
|
if ($^O eq 'MSWin32') { |
27
|
56
|
|
|
56
|
|
526
|
no warnings 'redefine'; |
|
56
|
|
|
|
|
172
|
|
|
56
|
|
|
|
|
10837
|
|
28
|
|
|
|
|
|
|
*_build_hostname = sub { |
29
|
0
|
|
|
|
|
0
|
my ( $self, $req ) = @_; |
30
|
0
|
|
|
|
|
0
|
my $address = $req->address; |
31
|
0
|
0
|
|
|
|
0
|
return 'localhost' if $address eq '127.0.0.1'; |
32
|
0
|
|
|
|
|
0
|
return gethostbyaddr( inet_aton( $address ), AF_INET ); |
33
|
0
|
|
|
|
|
0
|
}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |