Skip to content

Commit 2ca97a4

Browse files
cavefireSVilgelm
andauthored
Update pkg/tapo/client.go
Co-authored-by: Sergey Vilgelm <[email protected]>
1 parent 8e4088e commit 2ca97a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/tapo/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ func dial(req *http.Request, brand, username, password string) (net.Conn, *http.
291291
if err != nil {
292292
return nil, nil, err
293293
}
294-
_, _ = io.Copy(io.Discard, res.Body) // ignore response body
294+
_, _ = io.Copy(io.Discard, res.Body) // discard leftovers
295+
_ = res.Body.Close() // ignore response body
295296

296297
auth := res.Header.Get("WWW-Authenticate")
297298

0 commit comments

Comments
 (0)