fix(wcth): match legacy TH w/ empty DNS reply (#546)
See https://github.com/ooni/probe/issues/1707#issuecomment-944322725
This commit is contained in:
@@ -51,8 +51,13 @@ func dnsMapFailure(failure *string) *string {
|
||||
// already checking for this specific error string.
|
||||
s := webconnectivity.DNSNameError
|
||||
return &s
|
||||
case netxlite.FailureDNSNoAnswer,
|
||||
netxlite.FailureDNSNonRecoverableFailure,
|
||||
case netxlite.FailureDNSNoAnswer:
|
||||
// In this case the legacy TH would produce an empty
|
||||
// reply that is not attached to any error.
|
||||
//
|
||||
// See https://github.com/ooni/probe/issues/1707#issuecomment-944322725
|
||||
return nil
|
||||
case netxlite.FailureDNSNonRecoverableFailure,
|
||||
netxlite.FailureDNSRefusedError,
|
||||
netxlite.FailureDNSServerMisbehaving,
|
||||
netxlite.FailureDNSTemporaryFailure:
|
||||
|
||||
@@ -31,7 +31,7 @@ func Test_dnsMapFailure(t *testing.T) {
|
||||
}, {
|
||||
name: "no answer",
|
||||
failure: stringPointerForString(netxlite.FailureDNSNoAnswer),
|
||||
want: stringPointerForString("dns_server_failure"),
|
||||
want: nil,
|
||||
}, {
|
||||
name: "non recoverable failure",
|
||||
failure: stringPointerForString(netxlite.FailureDNSNonRecoverableFailure),
|
||||
|
||||
Reference in New Issue
Block a user