Skip to content

Commit

Permalink
Converts the matched term to lower case before detecting the used mec…
Browse files Browse the repository at this point in the history
…hanism. (#50)

Fixes #49
  • Loading branch information
thirsch authored Apr 27, 2023
1 parent 03bdf80 commit 7a03f0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getTerms(): iterable
}
$cidr4 = array_key_exists('cidr4', $matches) && $matches['cidr4'] !== '' ? intval($matches['cidr4']) : null;
$cidr6 = array_key_exists('cidr6', $matches) && $matches['cidr6'] !== '' ? intval($matches['cidr6']) : null;
switch($matches['term']) {
switch(strtolower($matches['term'])) {
case Mechanism::ALL:
yield new All($term, $matches['qualifier']);
break;
Expand Down
16 changes: 16 additions & 0 deletions tests/issue49/issue49-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: Issue 49
tests:
include-permerror:
description: >-
Accept different upper and lower case mechanisms
helo: mail.example.net
host: 127.0.0.1
mailfrom: [email protected]
result: pass
zonedata:
example.com:
- SPF: 'v=spf1 iP4:127.0.0.1 ~aLL'
example.net:
- SPF: 'v=spf1 +All'
example.org:
- SPF: 'v=spf1 +IP4:127.0.0.1 -ALL'

0 comments on commit 7a03f0e

Please sign in to comment.