From 1c99427b2b5106f8b8b1267665bb7411de46681e Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 7 Dec 2022 14:24:05 +0100 Subject: [PATCH] [backport] fix(whatsapp): allow registration server to HTTP-fail (#1001) This diff backports 1f952b512452fdcc586996151bce017632ad8c9a. Like we did for whatsapp web, we care about doing a TLS handshake and getting an HTTP response but we don't care about the content because it may change and that would cause a false positive. Closes https://github.com/ooni/probe/issues/2384 --- internal/engine/experiment/whatsapp/whatsapp.go | 3 +-- internal/engine/experiment/whatsapp/whatsapp_test.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/engine/experiment/whatsapp/whatsapp.go b/internal/engine/experiment/whatsapp/whatsapp.go index e23962b226..b618e42119 100644 --- a/internal/engine/experiment/whatsapp/whatsapp.go +++ b/internal/engine/experiment/whatsapp/whatsapp.go @@ -25,7 +25,7 @@ const ( WebHTTPSURL = "https://web.whatsapp.com/" testName = "whatsapp" - testVersion = "0.10.0" + testVersion = "0.11.0" ) var endpointPattern = regexp.MustCompile(`^tcpconnect://e[0-9]{1,2}\.whatsapp\.net:[0-9]{3,5}$`) @@ -154,7 +154,6 @@ func (m Measurer) Run( } } inputs = append(inputs, urlgetter.MultiInput{ - Config: urlgetter.Config{FailOnHTTPError: true}, Target: RegistrationServiceURL, }) inputs = append(inputs, urlgetter.MultiInput{ diff --git a/internal/engine/experiment/whatsapp/whatsapp_test.go b/internal/engine/experiment/whatsapp/whatsapp_test.go index e62ec3fc8c..bc5c61882e 100644 --- a/internal/engine/experiment/whatsapp/whatsapp_test.go +++ b/internal/engine/experiment/whatsapp/whatsapp_test.go @@ -20,7 +20,7 @@ func TestNewExperimentMeasurer(t *testing.T) { if measurer.ExperimentName() != "whatsapp" { t.Fatal("unexpected name") } - if measurer.ExperimentVersion() != "0.10.0" { + if measurer.ExperimentVersion() != "0.11.0" { t.Fatal("unexpected version") } } @@ -336,7 +336,6 @@ func TestWeConfigureWebChecksCorrectly(t *testing.T) { } called := &atomicx.Int64{} emptyConfig := urlgetter.Config{} - configWithFailOnHTTPError := urlgetter.Config{FailOnHTTPError: true} measurer := whatsapp.Measurer{ Config: whatsapp.Config{}, Getter: func(ctx context.Context, g urlgetter.Getter) (urlgetter.TestKeys, error) { @@ -348,7 +347,7 @@ func TestWeConfigureWebChecksCorrectly(t *testing.T) { } case whatsapp.RegistrationServiceURL: called.Add(4) - if diff := cmp.Diff(g.Config, configWithFailOnHTTPError); diff != "" { + if diff := cmp.Diff(g.Config, emptyConfig); diff != "" { panic(diff) } default: