From 4824ed1a2cce3fb4ef1f563e68a11b852c1e670f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 6 Apr 2023 07:03:06 -0700 Subject: [PATCH] Fix data buffer parsing error --- src/utils/proxy/validate-widget-data.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/proxy/validate-widget-data.js b/src/utils/proxy/validate-widget-data.js index 57adc942..e81606ef 100644 --- a/src/utils/proxy/validate-widget-data.js +++ b/src/utils/proxy/validate-widget-data.js @@ -2,10 +2,8 @@ import widgets from "widgets/widgets"; export default function validateWidgetData(widget, endpoint, data) { let valid = true; - let dataParsed; - if (typeof data === 'object') { - dataParsed = data; - } else { + let dataParsed = data; + if (Buffer.isBuffer(data)) { try { dataParsed = JSON.parse(data); } catch (e) {