From 60d0c8b8538d821850827ba87c1b597b2b0db598 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 15 Nov 2012 01:35:15 -0500 Subject: [PATCH] headers: simplify required headers logic --- plugins/headers | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/headers b/plugins/headers index 4773ba1..ae7accb 100644 --- a/plugins/headers +++ b/plugins/headers @@ -132,11 +132,8 @@ sub hook_data_post { return (DECLINED, "immune") if $self->is_immune(); foreach my $h ( @required_headers ) { - if ( ! $header->get($h) ) { - return $self->get_reject( - "We require a valid $h header", "no $h header" - ); - }; + next if $header->get($h); + return $self->get_reject( "We require a valid $h header", "no $h header"); }; foreach my $h ( @singular_headers ) {