Skip to content

Commit

Permalink
[backport] fix(whatsapp): allow registration server to HTTP-fail (#1001)
Browse files Browse the repository at this point in the history
This diff backports 1f952b5.

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 ooni/probe#2384
  • Loading branch information
bassosimone committed Dec 7, 2022
1 parent e3bf526 commit 1c99427
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/engine/experiment/whatsapp/whatsapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}$`)
Expand Down Expand Up @@ -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{
Expand Down
5 changes: 2 additions & 3 deletions internal/engine/experiment/whatsapp/whatsapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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:
Expand Down

0 comments on commit 1c99427

Please sign in to comment.