From 0c1d1e21be6a1e1e11fb307b908c0545ea2b6103 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Mon, 10 Jan 2022 09:52:51 -0600 Subject: [PATCH] adds trace to bad data for inspection --- cmd/tpapi/httpTemplates.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tpapi/httpTemplates.go b/cmd/tpapi/httpTemplates.go index b5c676b..b48c32b 100644 --- a/cmd/tpapi/httpTemplates.go +++ b/cmd/tpapi/httpTemplates.go @@ -200,10 +200,11 @@ func tmpltTPlinkPost(w http.ResponseWriter, r *http.Request) { err := json.NewDecoder(r.Body).Decode(&payload) if err != nil { + log.Printf("[TRACE] Data received: %#v\n", r.Body) log.Printf("[INFO] Unable to parse payload from API call: %v\n", err) tmpltError(w, http.StatusInternalServerError, fmt.Sprintf("Unable to read info from device: %v\n", err)) return } log.Printf("[TRACE] Data received: %#v\n", payload) -} \ No newline at end of file +}