Fix RBL score: return A+ when not listed on any blocklist
Move the ListedCount check before scoringListCount calculation so we return early with a perfect score when the IP/domain is not listed, regardless of how many informational-only lists exist.
This commit is contained in:
parent
dee848d887
commit
dfa38e8a26
1 changed files with 2 additions and 2 deletions
|
|
@ -305,11 +305,11 @@ func (r *DNSListChecker) CalculateScore(results *DNSListResults) (int, string) {
|
|||
return 100, ""
|
||||
}
|
||||
|
||||
scoringListCount := len(r.Lists) - len(r.informationalSet)
|
||||
if scoringListCount <= 0 {
|
||||
if results.ListedCount <= 0 {
|
||||
return 100, "A+"
|
||||
}
|
||||
|
||||
scoringListCount := len(r.Lists) - len(r.informationalSet)
|
||||
percentage := 100 - results.RelevantListedCount*100/scoringListCount
|
||||
return percentage, ScoreToGrade(percentage)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue