headers: simplify required headers logic
This commit is contained in:
parent
85cead39f8
commit
4465b7af43
@ -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 ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user