From 2ca97a42c5769f57c0605ba433701d8bf4f43eff Mon Sep 17 00:00:00 2001 From: Timo Christeleit Date: Thu, 9 Jan 2025 09:44:23 +0100 Subject: [PATCH] Update pkg/tapo/client.go Co-authored-by: Sergey Vilgelm <523825+SVilgelm@users.noreply.github.com> --- pkg/tapo/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tapo/client.go b/pkg/tapo/client.go index 78bf5fce..c19267ff 100644 --- a/pkg/tapo/client.go +++ b/pkg/tapo/client.go @@ -291,7 +291,8 @@ func dial(req *http.Request, brand, username, password string) (net.Conn, *http. if err != nil { return nil, nil, err } - _, _ = io.Copy(io.Discard, res.Body) // ignore response body + _, _ = io.Copy(io.Discard, res.Body) // discard leftovers + _ = res.Body.Close() // ignore response body auth := res.Header.Get("WWW-Authenticate")