From a85cc887de42f43af064ffb8ec86ce862bfa2003 Mon Sep 17 00:00:00 2001 From: kenny-statsig <111380336+kenny-statsig@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:32:14 -0700 Subject: [PATCH] Fix GCIR test (#220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was failing because the HTTP client we're using in the test seems to be automatically attaching a User Agent to all requests. So /initialize was evaluating the browser test gate incorrectly ![Screenshot 2024-08-20 at 11.23.46 AM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/ak7zkUsSoHh2VQAhtjtL/13f9b9ab-6698-46c3-a36a-6c228e43ce99.png) Fixed by setting it to "" ![Screenshot 2024-08-20 at 11.23.28 AM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/ak7zkUsSoHh2VQAhtjtL/9c2b0e24-0a35-41ee-9f4a-6c634da3415b.png) --- client_initialize_response_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client_initialize_response_test.go b/client_initialize_response_test.go index 194bf34..f7e4a52 100644 --- a/client_initialize_response_test.go +++ b/client_initialize_response_test.go @@ -44,6 +44,7 @@ func TestInitializeResponseConsistency(t *testing.T) { req.Header.Add("STATSIG-CLIENT-TIME", strconv.FormatInt(getUnixMilli(), 10)) req.Header.Add("STATSIG-SDK-TYPE", getStatsigMetadata().SDKType) req.Header.Add("STATSIG-SDK-VERSION", getStatsigMetadata().SDKVersion) + req.Header.Set("User-Agent", "") client := http.Client{} response, err := client.Do(req) if err != nil {