File Coverage

blib/lib/Mail/DKIM/Canonicalization/nowsp.pm
Criterion Covered Total %
statement 12 25 48.0
branch 0 4 0.0
condition n/a
subroutine 4 7 57.1
pod 0 3 0.0
total 16 39 41.0


line stmt bran cond sub pod time code
1             package Mail::DKIM::Canonicalization::nowsp;
2 15     15   108 use strict;
  15         30  
  15         743  
3 15     15   97 use warnings;
  15         51  
  15         1296  
4             our $VERSION = '1.20240923'; # VERSION
5             # ABSTRACT: nowsp canonicalization
6              
7             # Copyright 2005 Messiah College. All rights reserved.
8             # Jason Long
9              
10             # This program is free software; you can redistribute it and/or
11             # modify it under the same terms as Perl itself.
12              
13 15     15   119 use base 'Mail::DKIM::Canonicalization::DkimCommon';
  15         28  
  15         9009  
14 15     15   117 use Carp;
  15         34  
  15         5324  
15              
16             sub canonicalize_header {
17 0     0 0   my $self = shift;
18 0 0         croak 'wrong number of parameters' unless ( @_ == 1 );
19 0           my ($line) = @_;
20              
21             # remove all whitespace
22 0           $line =~ s/[ \t\015\012]//g;
23              
24 0 0         if ( $line =~ /^([^:]+):(.*)$/ ) {
25              
26             # lowercase field name
27 0           $line = lc($1) . ":$2";
28             }
29              
30 0           return $line;
31             }
32              
33             sub canonicalize_body {
34 0     0 0   my $self = shift;
35 0           my ($multiline) = @_;
36              
37 0           $multiline =~ s/[ \t\015\012]//g;
38 0           return $multiline;
39             }
40              
41             sub finish_body {
42 0     0 0   my $self = shift;
43 0           $self->SUPER::finish_body;
44             }
45              
46             1;
47              
48             __END__