general: add unit tests for >80% coverage

Includes a few minor fixes:
- frontend: support setting port for WHOIS server
- proxy: fix handling of very long lines
- proxy: refactor IP allowlist logic, parse allow IP list at startup
This commit is contained in:
Lan Tian
2023-05-06 00:23:28 -07:00
parent ccd14af0c8
commit a0246ccee2
24 changed files with 1576 additions and 65 deletions

View File

@@ -65,7 +65,7 @@ func shortenWhoisFilter(whois string) string {
shouldSkip := false
shouldSkip = shouldSkip || len(s) == 0
shouldSkip = shouldSkip || len(s) > 0 && s[0] == '#'
shouldSkip = shouldSkip || strings.Contains(strings.ToUpper(s), "REDACTED FOR PRIVACY")
shouldSkip = shouldSkip || strings.Contains(strings.ToUpper(s), "REDACTED")
if shouldSkip {
skippedLinesLonger++