line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::BIMI::Role::HasHTTPClient; |
2
|
|
|
|
|
|
|
# ABSTRACT: Class to model a HTTP client |
3
|
|
|
|
|
|
|
our $VERSION = '3.20210225'; # VERSION |
4
|
30
|
|
|
30
|
|
20146
|
use 5.20.0; |
|
30
|
|
|
|
|
120
|
|
5
|
30
|
|
|
30
|
|
179
|
use Moose::Role; |
|
30
|
|
|
|
|
65
|
|
|
30
|
|
|
|
|
244
|
|
6
|
30
|
|
|
30
|
|
160446
|
use Mail::BIMI::Prelude; |
|
30
|
|
|
|
|
78
|
|
|
30
|
|
|
|
|
243
|
|
7
|
30
|
|
|
30
|
|
25342
|
use HTTP::Tiny::Paranoid; |
|
30
|
|
|
|
|
2718818
|
|
|
30
|
|
|
|
|
11137
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has http_client => ( is => 'rw', lazy => 1, builder => '_build_http_client', |
10
|
|
|
|
|
|
|
documentation => 'HTTP::Tiny::Paranoid (or similar) object used for HTTP operations' ); |
11
|
|
|
|
|
|
|
requires 'http_client_max_fetch_size'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
my $http_client; |
16
|
23
|
|
|
23
|
|
55
|
sub _build_http_client($self) { |
|
23
|
|
|
|
|
49
|
|
|
23
|
|
|
|
|
40
|
|
17
|
23
|
100
|
|
|
|
442
|
return $http_client if $http_client; |
18
|
9
|
|
50
|
|
|
81
|
my $agent = 'Mail::BIMI ' . ( $Mail::BIMI::Version // 'dev' ); |
19
|
9
|
|
|
|
|
63
|
$http_client = HTTP::Tiny::Paranoid->new( |
20
|
|
|
|
|
|
|
agent => $agent, |
21
|
|
|
|
|
|
|
max_size => $self->http_client_max_fetch_size, |
22
|
|
|
|
|
|
|
max_redirect => $self->bimi_object->options->http_client_max_redirect, |
23
|
|
|
|
|
|
|
timeout => $self->bimi_object->options->http_client_timeout, |
24
|
|
|
|
|
|
|
verify_SSL => 1, # Certificates MUST verify |
25
|
|
|
|
|
|
|
); |
26
|
9
|
|
|
|
|
1373
|
return $http_client; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding UTF-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Mail::BIMI::Role::HasHTTPClient - Class to model a HTTP client |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
version 3.20210225 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Role for classes which require a HTTP Client implementation |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 REQUIRES |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=over 4 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item * L<HTTP::Tiny::Paranoid|HTTP::Tiny::Paranoid> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item * L<Mail::BIMI::Prelude|Mail::BIMI::Prelude> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item * L<Moose::Role|Moose::Role> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=back |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Marc Bradshaw <marc@marcbradshaw.net> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Marc Bradshaw. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
71
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |