File Coverage

blib/lib/Net/Amazon/S3/Request/Role/HTTP/Header/Content_md5.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Net::Amazon::S3::Request::Role::HTTP::Header::Content_md5;
2             # ABSTRACT: Content-MD5 header role
3             $Net::Amazon::S3::Request::Role::HTTP::Header::Content_md5::VERSION = '0.99';
4 99     99   72540 use Moose::Role;
  99         334  
  99         1019  
5 99     99   553399 use Digest::MD5 qw[];
  99         327  
  99         2424  
6 99     99   670 use MIME::Base64 qw[];
  99         313  
  99         15580  
7              
8             around _request_headers => sub {
9             my ($inner, $self) = @_;
10             my $content = $self->_http_request_content;
11              
12             my $value = MIME::Base64::encode_base64( Digest::MD5::md5( $content ) );
13             chomp $value;
14              
15             return ($self->$inner, ('Content-MD5' => $value));
16             };
17              
18             1;
19              
20             __END__
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Net::Amazon::S3::Request::Role::HTTP::Header::Content_md5 - Content-MD5 header role
29              
30             =head1 VERSION
31              
32             version 0.99
33              
34             =head1 AUTHOR
35              
36             Branislav ZahradnĂ­k <barney@cpan.org>
37              
38             =head1 COPYRIGHT AND LICENSE
39              
40             This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav ZahradnĂ­k.
41              
42             This is free software; you can redistribute it and/or modify it under
43             the same terms as the Perl 5 programming language system itself.
44              
45             =cut