From 8ceeed9278f7f75f5b8334cce08d2ba5828f21d9 Mon Sep 17 00:00:00 2001 From: jhot Date: Sat, 25 Nov 2023 07:03:46 +0000 Subject: [PATCH] Update internal/api/api.go --- internal/api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/api.go b/internal/api/api.go index fa5bc84..fc25f3c 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -158,7 +158,8 @@ func setEntityStateHandler(w http.ResponseWriter, r *http.Request) { var extras map[string]any err := render.DecodeJSON(r.Body, &extras) if err != nil { - l.Error("Error decoding JSON body", "error", err, "body", string(r.Body)) + b, _ := io.ReadAll(r.Body) + l.Error("Error decoding JSON body", "error", err, "body", string(b)) } var haErr error if err == nil && len(extras) > 0 {