From 863f8ec19b53719586ad468b7c90cb63bc5b3a24 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Sun, 10 Sep 2023 16:08:06 +0300 Subject: [PATCH] Fix malformed HTTP version for HomeKit source #620 --- pkg/hap/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/hap/client.go b/pkg/hap/client.go index 6d9ad37b..e61a018f 100644 --- a/pkg/hap/client.go +++ b/pkg/hap/client.go @@ -296,11 +296,13 @@ func (c *Client) PutCharacters(characters ...*Character) error { return err } - _, err = c.Put(PathCharacteristics, MimeJSON, bytes.NewReader(body)) + res, err := c.Put(PathCharacteristics, MimeJSON, bytes.NewReader(body)) if err != nil { return err } + _, _ = io.ReadAll(res.Body) // important to "clear" body + return nil }