From 767db7573092bb537eac663d6cd1319d51c81f14 Mon Sep 17 00:00:00 2001 From: Pooja Belaramani Date: Fri, 27 Dec 2024 16:10:57 +0530 Subject: [PATCH] update: comment --- packages/bruno-electron/src/ipc/network/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 6685e95a..84f49d07 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -366,12 +366,10 @@ const parseDataFromResponse = (response, disableParsingResponseJson = false) => // Filter out ZWNBSP character // https://gist.github.com/antic183/619f42b559b78028d1fe9e7ae8a1352d - // a quoated string is also a vaild json but we want to show it as a quoated string only (parsing removes the quoates) + // If the response is a string and starts and ends with double quotes, it's a stringified JSON and should not be parsed data = data.replace(/^\uFEFF/, ''); if ( !disableParsingResponseJson && ! (typeof data === 'string' && data.startsWith("\"") && data.endsWith("\""))) { data = JSON.parse(data); - } { - data = JSON.parse(data); } } catch { console.log('Failed to parse response data as JSON');