Skip to content

Commit

Permalink
Log product, os, and lang (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand authored May 23, 2024
1 parent e01f8ce commit 46c1fe5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions stubservice/stubhandlers/stubhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ func TestRedirectFull(t *testing.T) {
if sessionID != params.ExpectedSessionID {
t.Errorf("Expected session_id: %s, got: %v", params.ExpectedSessionID, sessionID)
}

product := entry.Data["product"]
if entry.Data["product"] != "firefox-stub" {
t.Errorf("Expected product: firefox-stub, got: %v", product)
}

os := entry.Data["os"]
if entry.Data["os"] != "win" {
t.Errorf("Expected os: win, got: %v", os)
}

lang := entry.Data["lang"]
if entry.Data["lang"] != "en-US" {
t.Errorf("Expected lang: en-US, got: %v", lang)
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions stubservice/stubhandlers/stubservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func (s *stubService) ServeHTTP(w http.ResponseWriter, req *http.Request) {
"client_id": code.ClientID,
"client_id_ga4": code.ClientIDGA4,
"session_id": code.SessionID,
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1896957
"product": query.Get("product"),
"os": query.Get("os"),
"lang": query.Get("lang"),
},
).Info("Download Started")

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

0 comments on commit 46c1fe5

Please sign in to comment.