clamdscan: make sure headers exist before operating on them
This commit is contained in:
parent
2bef491839
commit
01c994439b
@ -289,6 +289,8 @@ sub is_not_multipart {
|
|||||||
|
|
||||||
return if $self->{'_args'}{'scan_all'};
|
return if $self->{'_args'}{'scan_all'};
|
||||||
|
|
||||||
|
return 1 if ! $transaction->header;
|
||||||
|
|
||||||
# Ignore non-multipart emails
|
# Ignore non-multipart emails
|
||||||
my $content_type = $transaction->header->get('Content-Type') or return 1;
|
my $content_type = $transaction->header->get('Content-Type') or return 1;
|
||||||
$content_type =~ s/\s/ /g;
|
$content_type =~ s/\s/ /g;
|
||||||
|
@ -75,7 +75,12 @@ sub test_is_not_multipart {
|
|||||||
|
|
||||||
ok( $self->is_not_multipart(), "not_multipart" );
|
ok( $self->is_not_multipart(), "not_multipart" );
|
||||||
|
|
||||||
|
if ( $tran->header ) {
|
||||||
$tran->header->add('Content-Type', 'multipart/alternative; boundary="Jx3Wbb8BMHsO=_?:"');
|
$tran->header->add('Content-Type', 'multipart/alternative; boundary="Jx3Wbb8BMHsO=_?:"');
|
||||||
ok( ! $self->is_not_multipart(), "not_multipart" );
|
ok( ! $self->is_not_multipart(), "not_multipart" );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ok( 1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user