Skip to content

Commit 212dd60

Browse files
authored
Remove check on the source parameter (#170)
1 parent 5657a24 commit 212dd60

File tree

4 files changed

+0
-267
lines changed

4 files changed

+0
-267
lines changed

attributioncode/sourcewhitelist.go

Lines changed: 0 additions & 218 deletions
This file was deleted.

attributioncode/sourcewhitelist_test.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

attributioncode/validator.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,6 @@ func (v *Validator) Validate(code, sig, refererHeader string) (*Code, error) {
174174
}
175175
}
176176

177-
if source := vals.Get("source"); !isWhitelisted(source) {
178-
logEntry.WithField("source", source).Error("source is not in whitelist")
179-
vals.Set("source", "(other)")
180-
}
181-
182177
for _, val := range requiredAttributionKeys {
183178
if vals.Get(val) == "" {
184179
vals.Set(val, "(not set)")

stubservice/stubhandlers/stubhandler_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ func TestRedirectFull(t *testing.T) {
168168
ExpectedLocation: `/cdn/builds/firefox-stub/en-US/win/`,
169169
ExpectedCode: `campaign%3D%2528not%2Bset%2529%26content%3D%2528not%2Bset%2529%26dltoken%3D[\w\d-]+%26medium%3Dorganic%26source%3Dwww.google.com`,
170170
},
171-
{
172-
AttributionCode: `campaign=%28not+set%29&content=%28not+set%29&medium=organic&source=www.notinwhitelist.com`,
173-
Referer: "",
174-
ExpectedLocation: `/cdn/builds/firefox-stub/en-US/win/`,
175-
ExpectedCode: `campaign%3D%2528not%2Bset%2529%26content%3D%2528not%2Bset%2529%26dltoken%3D[\w\d-]+%26medium%3Dorganic%26source%3D%2528other%2529`,
176-
},
177171
{
178172
// We expect the product to be prefixed in the location URL below because
179173
// the attribution code contains data for RTAMO and the referer header
@@ -344,10 +338,6 @@ func TestDirectFull(t *testing.T) {
344338
AttributionCode: `campaign=%28not+set%29&content=%28not+set%29&medium=organic&source=www.google.com`,
345339
ExpectedCode: `campaign%3D%2528not%2Bset%2529%26content%3D%2528not%2Bset%2529%26dltoken%3D[\w\d-]+%26medium%3Dorganic%26source%3Dwww.google.com`,
346340
},
347-
{
348-
AttributionCode: `campaign=%28not+set%29&content=%28not+set%29&medium=organic&source=notinthewhitelist.com`,
349-
ExpectedCode: `campaign%3D%2528not%2Bset%2529%26content%3D%2528not%2Bset%2529%26dltoken%3D[\w\d-]+%26medium%3Dorganic%26source%3D%2528other%2529`,
350-
},
351341
} {
352342
testHook.Reset()
353343

0 commit comments

Comments
 (0)