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.20210301'; # VERSION |
4
|
30
|
|
|
30
|
|
19067
|
use 5.20.0; |
|
30
|
|
|
|
|
111
|
|
5
|
30
|
|
|
30
|
|
221
|
use Moose::Role; |
|
30
|
|
|
|
|
63
|
|
|
30
|
|
|
|
|
219
|
|
6
|
30
|
|
|
30
|
|
149150
|
use Mail::BIMI::Prelude; |
|
30
|
|
|
|
|
81
|
|
|
30
|
|
|
|
|
233
|
|
7
|
30
|
|
|
30
|
|
24034
|
use HTTP::Tiny::Paranoid; |
|
30
|
|
|
|
|
2544176
|
|
|
30
|
|
|
|
|
10314
|
|
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
|
|
56
|
sub _build_http_client($self) { |
|
23
|
|
|
|
|
45
|
|
|
23
|
|
|
|
|
39
|
|
17
|
23
|
100
|
|
|
|
390
|
return $http_client if $http_client; |
18
|
9
|
|
50
|
|
|
74
|
my $agent = 'Mail::BIMI ' . ( $Mail::BIMI::Version // 'dev' ); |
19
|
9
|
|
|
|
|
57
|
$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
|
|
|
|
|
1211
|
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.20210301 |
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 |