From f8711a91d95674e9eb634096ba860f7c4f6bded0 Mon Sep 17 00:00:00 2001 From: pooja-bruno Date: Mon, 23 Dec 2024 17:29:06 +0530 Subject: [PATCH] fix: plain text curl data (#3677) --- packages/bruno-app/src/utils/curl/curl-to-json.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bruno-app/src/utils/curl/curl-to-json.js b/packages/bruno-app/src/utils/curl/curl-to-json.js index 48c33bb0..c1398ab1 100644 --- a/packages/bruno-app/src/utils/curl/curl-to-json.js +++ b/packages/bruno-app/src/utils/curl/curl-to-json.js @@ -57,7 +57,7 @@ function getDataString(request) { console.error('Failed to parse JSON data:', error); return { data: request.data.toString() }; } - } else if (contentType && contentType.includes('application/xml')) { + } else if (contentType && (contentType.includes('application/xml') || contentType.includes('text/plain'))) { return { data: request.data }; } @@ -174,14 +174,14 @@ const curlToJson = (curlCommand) => { } if (request.auth) { - if(request.auth.mode === 'basic'){ + if (request.auth.mode === 'basic') { requestJson.auth = { mode: 'basic', basic: { username: repr(request.auth.basic?.username), password: repr(request.auth.basic?.password) } - } + }; } }