diff --git a/main.go b/main.go index 723f4b4..78886db 100644 --- a/main.go +++ b/main.go @@ -134,6 +134,12 @@ func fixScheme(u *url.URL) { func toWhitelist(okay []string, host string) bool { host = strings.Split(host, ":")[0] host = strings.Replace(host, "www.", "", -1) + host = strings.Replace(host, "http://", "", -1) + host = strings.Replace(host, "https://", "", -1) + hosts := strings.Split(host, ".") + if len(hosts) > 1 { + host = hosts[len(hosts)-2] + "." + hosts[len(hosts)-1] + } for i := range okay { if strings.Contains(okay[i], host) { return true