fix(netxlite/dns): more stricly mirror stdlib error strings (#513)
This diff attempts to modify the errors reported by our custom resolver by matching more strings from the stdlib. Part of https://github.com/ooni/probe/issues/1733 and diff has been extracted from https://github.com/ooni/probe-cli/pull/506.
This commit is contained in:
parent
201f602a40
commit
24b230fd38
17 changed files with 177 additions and 52 deletions
|
|
@ -175,3 +175,18 @@ func TestDNSOverHTTPSHostOverride(t *testing.T) {
|
|||
t.Fatal("did not see correct host override")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDNSOverHTTPSCloseIdleConnections(t *testing.T) {
|
||||
var called bool
|
||||
doh := &DNSOverHTTPS{
|
||||
Client: &mocks.HTTPClient{
|
||||
MockCloseIdleConnections: func() {
|
||||
called = true
|
||||
},
|
||||
},
|
||||
}
|
||||
doh.CloseIdleConnections()
|
||||
if !called {
|
||||
t.Fatal("not called")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue