-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export the slice of WHOIS/SharedHosting matchers
- Loading branch information
Bradley Kemp
committed
May 23, 2021
1 parent
9892d51
commit 852b710
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ import ( | |
// If this matches, these contact details should be preferred over the | ||
// registrar and hosting provider. | ||
func IsSharedHostingProvider(u *url.URL) (bool, ProviderContact) { | ||
for _, m := range sharedHostMatchers { | ||
if m.matches(u.Host) { | ||
return true, m.contact | ||
for _, m := range SharedHosts { | ||
if m.Matches(u.Host) { | ||
return true, m.Contact | ||
} | ||
} | ||
return false, nil | ||
|
@@ -21,7 +21,7 @@ func IsSharedHostingProvider(u *url.URL) (bool, ProviderContact) { | |
// is not served by the domain/server owner. | ||
// | ||
// Try to keep this sorted alphabetically by ProviderName | ||
var sharedHostMatchers = []matcher{ | ||
var SharedHosts = []Matcher{ | ||
{OnlineForm{"000webhost", "https://www.000webhost.com/report-abuse"}, isSubDomainOf("000webhost.com", "000webhostapp.com")}, | ||
{AbuseEmail{"Adobe", "[email protected]"}, isSubDomainOf("spark.adobe.com")}, | ||
{OnlineForm{"Bitly", "https://bitly.is/reporting-abuse"}, isSubDomainOf("bit.ly")}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import ( | |
// Matches WHOIS data to the best way to report abuse to the registrar/hosting provider. | ||
// | ||
// Try to keep this sorted alphabetically by ProviderName | ||
var whoisMatchers = []matcher{ | ||
var WHOIS = []Matcher{ | ||
{OnlineForm{"Cloudflare", "https://www.cloudflare.com/abuse/form"}, whoisContains("[email protected]")}, | ||
{OnlineForm{"Digital Ocean", "https://www.digitalocean.com/company/contact/#abuse"}, whoisContains("descr: Digital Ocean, Inc.")}, | ||
{OnlineForm{"Dynadot", "https://www.dynadot.com/report_abuse.html"}, whoisContains("[email protected]")}, | ||
|
@@ -39,13 +39,13 @@ func getContactsFromWHOIS(query string) ([]ProviderContact, error) { | |
} | ||
|
||
var contacts []ProviderContact | ||
for _, m := range whoisMatchers { | ||
if m.matches(string(rawWhois)) { | ||
contacts = append(contacts, m.contact) | ||
for _, m := range WHOIS { | ||
if m.Matches(string(rawWhois)) { | ||
contacts = append(contacts, m.Contact) | ||
} | ||
} | ||
|
||
// One of the whoisMatchers matched so return that info | ||
// One of the WHOIS matched so return that info | ||
if len(contacts) > 0 { | ||
return contacts, nil | ||
} | ||
|