fix(netxlite/quic): wrap Close (#509)

While there, make sure netxlite has 100% coverage.

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:
Simone Basso 2021-09-27 14:14:17 +02:00 committed by GitHub
commit 273774bb03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 1 deletions

View file

@ -75,7 +75,12 @@ func TestHTTPTransportLogger(t *testing.T) {
},
}
client := &http.Client{Transport: txp}
resp, err := client.Get("https://www.google.com")
req, err := http.NewRequest("GET", "https://www.google.com", nil)
if err != nil {
t.Fatal(err)
}
req.Header.Set("User-Agent", "miniooni/0.1.0-dev")
resp, err := client.Do(req)
if err != nil {
t.Fatal(err)
}