Skip to content

Commit

Permalink
tools/internal/parser: remove workarounds for fixed PSL blocks (publi…
Browse files Browse the repository at this point in the history
…csuffix#2010)

* tools/internal/parser: update exceptions for cleaned legacy blocks

* tools/internal/parser: remove one-off hacks for fixed blocks
  • Loading branch information
danderson authored Jun 24, 2024
1 parent 2860ee4 commit 3b1b0d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
4 changes: 2 additions & 2 deletions tools/internal/parser/exceptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ var missingEmail = []string{
"hashbang.sh",
),
lines(
"// HostyHosting (hostyhosting.com)",
"// HostyHosting (https://hostyhosting.com)",
"hostyhosting.io",
),
lines(
Expand All @@ -363,7 +363,7 @@ var missingEmail = []string{
"torun.pl",
),
lines(
"// TASK geographical domains (www.task.gda.pl/uslugi/dns)",
"// TASK geographical domains (https://www.task.gda.pl/uslugi/dns)",
"gda.pl",
"gdansk.pl",
"gdynia.pl",
Expand Down
27 changes: 0 additions & 27 deletions tools/internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,6 @@ func splitNameish(line string) (name string, url *url.URL, submitter *mail.Addre
}
}

// A single entry uses the unicode fullwidth colon codepoint
// (U+FF1A) instead of an ascii colon. Correct that before
// attempting a parse.
//
// TODO: fix the source and delete this hack.
if strings.Contains(line, "Future Versatile Group") {
line = strings.Replace(line, "\uff1a", ":", -1)
}

name, rest, ok := strings.Cut(line, ":")
if !ok {
return "", nil, nil
Expand Down Expand Up @@ -374,14 +365,6 @@ func splitNameAndURLInParens(line string) (name string, url *url.URL, ok bool) {
name = strings.TrimSpace(line[:idx])
urlStr := strings.TrimSpace(line[idx+1 : len(line)-1])

// Two PSL entries omit the scheme at the front of the URL, which
// makes them invalid by getURL's standards.
//
// TODO: fix the source and delete this hack.
if urlStr == "www.task.gda.pl/uslugi/dns" || urlStr == "hostyhosting.com" {
urlStr = "https://" + urlStr
}

if u := getURL(urlStr); u != nil {
return name, u, true
}
Expand Down Expand Up @@ -440,16 +423,6 @@ func getSubmitter(line string) *mail.Address {
return addr
}

// One current entry is missing the closing chevron on the email,
// which makes it an invalid address.
//
// TODO: fix the source and delete this hack.
if strings.HasSuffix(line, "torproject.org") {
if addr, err := mail.ParseAddress(line + ">"); err == nil {
return addr
}
}

// One current entry uses old school email obfuscation to foil
// spam bots, which makes it an invalid address.
//
Expand Down

0 comments on commit 3b1b0d0

Please sign in to comment.