You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug 1567320: add support for funnel_experiment and funnel_variation a… (#95)
* bug 1567320: add support for funnel_experiment and funnel_variation attribution keys
* add funnel params to test and fix length test
* add original test back
* validator: increase accepted code length to 600
* s/funnel_//
* set maxUnescapedCodeLen to match AttributionCode.jsm
* fix pingdom test
* fix tests and allow blank inputs
* add ua attribution key
* return error if code is empty
* tests to account for code is empty
Copy file name to clipboardExpand all lines: attributioncode/validator.go
+35-13
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,33 @@ import (
5
5
"crypto/sha256"
6
6
"encoding/base64"
7
7
"encoding/hex"
8
+
"fmt"
8
9
"net/url"
9
10
"time"
10
11
11
12
"github.com/pkg/errors"
12
13
"github.com/sirupsen/logrus"
13
14
)
14
15
16
+
// Set to match https://searchfox.org/mozilla-central/rev/a92ed79b0bc746159fc31af1586adbfa9e45e264/browser/components/attribution/AttributionCode.jsm#24
17
+
constmaxUnescapedCodeLen=1010
18
+
15
19
varvalidAttributionKeys=map[string]bool{
16
-
"source": true,
17
-
"medium": true,
18
-
"campaign": true,
19
-
"content": true,
20
+
"source": true,
21
+
"medium": true,
22
+
"campaign": true,
23
+
"content": true,
24
+
"experiment": true,
25
+
"variation": true,
26
+
"ua": true,
27
+
}
28
+
29
+
// If any of these are not set in the incoming payload, they will be set to '(not set)'
0 commit comments