headers: simplify required headers logic

This commit is contained in:
Matt Simerson 2012-11-15 01:35:15 -05:00
parent 85cead39f8
commit 4465b7af43

View File

@ -132,11 +132,8 @@ sub hook_data_post {
return (DECLINED, "immune") if $self->is_immune(); return (DECLINED, "immune") if $self->is_immune();
foreach my $h ( @required_headers ) { foreach my $h ( @required_headers ) {
if ( ! $header->get($h) ) { next if $header->get($h);
return $self->get_reject( return $self->get_reject( "We require a valid $h header", "no $h header");
"We require a valid $h header", "no $h header"
);
};
}; };
foreach my $h ( @singular_headers ) { foreach my $h ( @singular_headers ) {