diff --git a/cmd/badges/main.go b/cmd/badges/main.go index 468315c06..9c4d4b0e1 100644 --- a/cmd/badges/main.go +++ b/cmd/badges/main.go @@ -59,6 +59,11 @@ func main() { return } + if filterBad(loc) { + log.Error().Str(uniqueCode, "bfee4bd8").Str("loc", loc.String()).Msg("filter bad") + return + } + appendLocationLog(loc.String()) res, err := process(1, loc) @@ -99,6 +104,23 @@ func main() { } } +func filterBad(loc location) bool { + l := loc.String() + bad := []string{"wp-content.com", "wp-admin.com", ".well-known", "wp-includes.com", ".php"} + count := 0 + for _, b := range bad { + if strings.Contains(l, b) { + count++ + } + } + + if count >= 2 { + return true + } + + return false +} + func appendLocationLog(log string) { locationLogMutex.Lock() defer locationLogMutex.Unlock()