Skip to content

Commit

Permalink
Make sure domains added to DAWG are lowercase
Browse files Browse the repository at this point in the history
This matches change in edm:
dnstapir/edm@09605cb

This way the room for capitalisation mismatches are minimised.
  • Loading branch information
eest committed Oct 21, 2024
1 parent 4dc24b6 commit 5df8d65
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dawg_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ package tapir

import (
"bufio"
"fmt"
"os"

"encoding/csv"
"fmt"
"io"
"log"
"os"
"slices"
"strings"

"github.com/miekg/dns"

Expand Down Expand Up @@ -53,7 +53,6 @@ func ParseCSV(srcfile string, dstmap map[string]TapirName, dontsort bool) ([]str
if dontsort {
dstmap[name] = TapirName{Name: name}
} else {

// Make sure the domain is fully qualified (includes
// the root domain dot at the end) as this is expected
// by miekg/dns when comparing against a dns question
Expand Down Expand Up @@ -113,7 +112,7 @@ func CreateDawg(sortedDomains []string, outfile string) error {
fmt.Printf("Creating DAWG data structure\n")
dawg := dawg.New()
for _, domain := range sortedDomains {
dawg.Add(domain)
dawg.Add(strings.ToLower(domain))
if GlobalCF.Debug {
fmt.Printf("Added \"%s\" to DAWG\n", domain)
}
Expand Down

0 comments on commit 5df8d65

Please sign in to comment.