line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ACME2::HTTP::Convert; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
96
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
74
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
17
|
use HTTP::Tiny::UA::Response (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
40
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
14
|
use Net::ACME2::X (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
498
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub http_tiny_to_net_acme2 { |
11
|
54
|
|
|
54
|
0
|
200
|
my ($method, $resp) = @_; |
12
|
|
|
|
|
|
|
|
13
|
54
|
|
|
|
|
406
|
my $resp_obj = HTTP::Tiny::UA::Response->new($resp); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#cf. HTTP::Tiny docs |
16
|
54
|
50
|
|
|
|
4962
|
if ( $resp_obj->status() == 599 ) { |
17
|
|
|
|
|
|
|
die Net::ACME2::X->create( |
18
|
|
|
|
|
|
|
'HTTP::Network', |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
method => $method, |
21
|
|
|
|
|
|
|
url => $resp_obj->url(), |
22
|
|
|
|
|
|
|
error => $resp_obj->content(), |
23
|
0
|
|
|
|
|
0
|
redirects => $resp->{'redirects'}, |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
54
|
50
|
|
|
|
580
|
if ( $resp->{'status'} >= 400 ) { |
29
|
|
|
|
|
|
|
die Net::ACME2::X->create( |
30
|
|
|
|
|
|
|
'HTTP::Protocol', |
31
|
|
|
|
|
|
|
{ |
32
|
|
|
|
|
|
|
method => $method, |
33
|
|
|
|
|
|
|
redirects => $resp->{'redirects'}, |
34
|
0
|
|
|
|
|
0
|
( map { ( $_ => $resp_obj->$_() ) } qw( content status reason url headers ) ), |
|
0
|
|
|
|
|
0
|
|
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
54
|
|
|
|
|
389
|
return $resp_obj; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |