Skip to content

Commit

Permalink
Merge ba231f7 into 4db5b06
Browse files Browse the repository at this point in the history
  • Loading branch information
hoosteeno committed Jun 7, 2018
2 parents 4db5b06 + ba231f7 commit d5e6adc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 1 addition & 6 deletions attributioncode/sourcewhitelist.go
Expand Up @@ -24,6 +24,7 @@ var sourceWhitelistRegexps = []*regexp.Regexp{
regexp.MustCompile(`^\w+\.facebook\.com$`),
regexp.MustCompile(`^[\w-]+\.wikipedia\.org$`),
regexp.MustCompile(`^(\w+\.)*firefox\.com$`),
regexp.MustCompile(`^([\w-]*\.)?mozilla\.org$`),
}

var sourceWhitelist = map[string]bool{
Expand All @@ -48,7 +49,6 @@ var sourceWhitelist = map[string]bool{

"accounts.firefox.com": true,
"activations.cdn.mozilla.net": true,
"addons.mozilla.org": true,
"answers.yahoo.com": true,
"ar.search.yahoo.com": true,
"at.search.yahoo.com": true,
Expand All @@ -68,7 +68,6 @@ var sourceWhitelist = map[string]bool{
"cse.google.com": true,
"cto.mail.ru": true,
"de.search.yahoo.com": true,
"developer.mozilla.org": true,
"dk.search.yahoo.com": true,
"duckduckgo.com": true,
"e.mail.ru": true,
Expand Down Expand Up @@ -97,7 +96,6 @@ var sourceWhitelist = map[string]bool{
"global.bing.com": true,
"go.mail.ru": true,
"gr.search.yahoo.com": true,
"hacks.mozilla.org": true,
"hangouts.google.com": true,
"help.ea.com": true,
"help.mail.ru": true,
Expand Down Expand Up @@ -131,7 +129,6 @@ var sourceWhitelist = map[string]bool{
"mozilla.hu": true,
"mozilla.jp": true,
"mozilla.lt": true,
"mozilla.org": true,
"mozilla.pl": true,
"mozilla.ro": true,
"mozilla.rs": true,
Expand Down Expand Up @@ -174,7 +171,6 @@ var sourceWhitelist = map[string]bool{
"suche.gmx.at": true,
"suche.gmx.net": true,
"support.google.com": true,
"support.mozilla.org": true,
"takeout.google.com": true,
"talkgadget.google.com": true,
"tanks.mail.ru": true,
Expand Down Expand Up @@ -211,7 +207,6 @@ var sourceWhitelist = map[string]bool{
"www.google.sr": true,
"www.kongregate.com": true,
"www.miniclip.com": true,
"www.mozilla.org": true,
"www.qwant.com": true,
"www.seznam.cz": true,
"www.softonic.com": true,
Expand Down
6 changes: 6 additions & 0 deletions attributioncode/sourcewhitelist_test.go
Expand Up @@ -19,6 +19,12 @@ func TestIsWhitelisted(t *testing.T) {
{"www.google.co.id", true},
{"www.google.cz", true},
{"www.randomdomain.com", false},

{"addons.mozilla.org", true},
{"developer.mozilla.org", true},
{"mozilla.org", true},
{"support.mozilla.org", true},
{"www.mozilla.org", true},
}
for _, c := range cases {
if isWhitelisted(c.Domain) != c.Valid {
Expand Down

0 comments on commit d5e6adc

Please sign in to comment.