From 0ef78166063a0c9d5af5a3e52f63b3a20a90c61f Mon Sep 17 00:00:00 2001 From: William Durand Date: Wed, 22 May 2024 22:52:49 +0200 Subject: [PATCH] Log product, os, and lang --- stubservice/stubhandlers/stubhandler_test.go | 15 +++++++++++++++ stubservice/stubhandlers/stubservice.go | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/stubservice/stubhandlers/stubhandler_test.go b/stubservice/stubhandlers/stubhandler_test.go index 2a8e378f..5415350e 100644 --- a/stubservice/stubhandlers/stubhandler_test.go +++ b/stubservice/stubhandlers/stubhandler_test.go @@ -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) + } } } } diff --git a/stubservice/stubhandlers/stubservice.go b/stubservice/stubhandlers/stubservice.go index 62895f1f..df63aee0 100644 --- a/stubservice/stubhandlers/stubservice.go +++ b/stubservice/stubhandlers/stubservice.go @@ -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") @@ -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") }