diff --git a/client/web/web_test.go b/client/web/web_test.go index fbfd8ad18..d8c25107e 100644 --- a/client/web/web_test.go +++ b/client/web/web_test.go @@ -76,14 +76,16 @@ func TestQnapAuthnURL(t *testing.T) { // 2. localapi proxy allowlist func TestServeAPI(t *testing.T) { lal := memnet.Listen("local-tailscaled.sock:80") - defer lal.Close() // Serve dummy localapi. Just returns "success". go func() { localapi := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "success") })} + defer localapi.Close() + defer lal.Close() + if err := localapi.Serve(lal); err != nil { t.Error(err) }