fix(webconnectivity): allow measuring https://1.1.1.1 (#241)
* fix(webconnectivity): allow measuring https://1.1.1.1 There were two issues preventing us from doing so: 1. in netx, the address resolver was too later in the resolver chain. Therefore, its result wasn't added to the events. 2. when building the DNSCache (in httpget.go), we didn't consider the case where the input is an address. We need to treat this case specially to make sure there is no DNSCache. See https://github.com/ooni/probe/issues/1376. * fix: add unit tests for code making the dnscache * fix(netx): make sure all tests pass * chore: bump webconnectivity version
This commit is contained in:
parent
55bdebe8b2
commit
2ef5fb503a
8 changed files with 80 additions and 45 deletions
|
|
@ -25,3 +25,20 @@ func TestHTTPGet(t *testing.T) {
|
|||
t.Fatal(*r.Failure)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPGetMakeDNSCache(t *testing.T) {
|
||||
// test for input being an IP
|
||||
out := webconnectivity.HTTPGetMakeDNSCache(
|
||||
"1.1.1.1", "1.1.1.1",
|
||||
)
|
||||
if out != "" {
|
||||
t.Fatal("expected empty output here")
|
||||
}
|
||||
// test for input being a domain
|
||||
out = webconnectivity.HTTPGetMakeDNSCache(
|
||||
"dns.google", "8.8.8.8 8.8.4.4",
|
||||
)
|
||||
if out != "dns.google 8.8.8.8 8.8.4.4" {
|
||||
t.Fatal("expected ordinary output here")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue