Skip to content

Commit 46c1fe5

Browse files
authored
Log product, os, and lang (#221)
1 parent e01f8ce commit 46c1fe5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

stubservice/stubhandlers/stubhandler_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,21 @@ func TestRedirectFull(t *testing.T) {
333333
if sessionID != params.ExpectedSessionID {
334334
t.Errorf("Expected session_id: %s, got: %v", params.ExpectedSessionID, sessionID)
335335
}
336+
337+
product := entry.Data["product"]
338+
if entry.Data["product"] != "firefox-stub" {
339+
t.Errorf("Expected product: firefox-stub, got: %v", product)
340+
}
341+
342+
os := entry.Data["os"]
343+
if entry.Data["os"] != "win" {
344+
t.Errorf("Expected os: win, got: %v", os)
345+
}
346+
347+
lang := entry.Data["lang"]
348+
if entry.Data["lang"] != "en-US" {
349+
t.Errorf("Expected lang: en-US, got: %v", lang)
350+
}
336351
}
337352
}
338353
}

stubservice/stubhandlers/stubservice.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func (s *stubService) ServeHTTP(w http.ResponseWriter, req *http.Request) {
5858
"client_id": code.ClientID,
5959
"client_id_ga4": code.ClientIDGA4,
6060
"session_id": code.SessionID,
61+
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1896957
62+
"product": query.Get("product"),
63+
"os": query.Get("os"),
64+
"lang": query.Get("lang"),
6165
},
6266
).Info("Download Started")
6367

@@ -104,6 +108,10 @@ func (s *stubService) ServeHTTP(w http.ResponseWriter, req *http.Request) {
104108
"client_id": code.ClientID,
105109
"client_id_ga4": code.ClientIDGA4,
106110
"session_id": code.SessionID,
111+
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1896957
112+
"product": query.Get("product"),
113+
"os": query.Get("os"),
114+
"lang": query.Get("lang"),
107115
},
108116
).Info("Download Finished")
109117
}

0 commit comments

Comments
 (0)