Skip to content

Commit

Permalink
Merge pull request #13 from dnstapir/lowercase_dawg_zones
Browse files Browse the repository at this point in the history
Make sure domains added to DAWG are lowercase
  • Loading branch information
johanix authored Nov 12, 2024
2 parents 4dc24b6 + 5df8d65 commit 80172b1
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 80172b1

Please sign in to comment.