File Coverage

blib/lib/Mail/DKIM/Canonicalization/dk_nofws.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Mail::DKIM::Canonicalization::dk_nofws;
2 7     7   49 use strict;
  7         15  
  7         201  
3 7     7   35 use warnings;
  7         14  
  7         282  
4             our $VERSION = '1.20230630'; # VERSION
5             # ABSTRACT: nofws canonicalization
6              
7             # Copyright 2005-2006 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 7     7   51 use base 'Mail::DKIM::Canonicalization::dk_simple';
  7         15  
  7         809  
14 7     7   53 use Carp;
  7         16  
  7         1856  
15              
16             sub canonicalize_header {
17 94     94 0 152 my $self = shift;
18 94         173 my ($line) = @_;
19              
20 94         456 $line =~ s/[ \t\015\012]//g;
21 94         305 return $self->SUPER::canonicalize_header( $line . "\015\012" );
22             }
23              
24             sub canonicalize_body {
25 30     30 0 51 my $self = shift;
26 30         63 my ($multiline) = @_;
27              
28 30         224 $multiline =~ s/[ \t]//g;
29 30         112 $multiline =~ s/\015(?!\012)//g; # standalone CR
30 30         74 $multiline =~ s/([^\015])\012/$1/g; # standalone LF
31 30         84 return $self->SUPER::canonicalize_body($multiline);
32             }
33              
34             1;
35              
36             __END__