From 330a7ad18a7ec012ee0e972ae80bfb0a4d2af961 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Tue, 2 May 2023 15:25:07 +0530 Subject: [PATCH] fix: fixed bug where content type was getting overwritten everytime as application/x-www-form-urlencoded --- packages/bruno-cli/src/runner/run-single-request.js | 2 +- packages/bruno-electron/src/ipc/network/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js index e2ce6a83..950c0790 100644 --- a/packages/bruno-cli/src/runner/run-single-request.js +++ b/packages/bruno-cli/src/runner/run-single-request.js @@ -41,7 +41,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll interpolateVars(request, envVariables, collectionVariables); // stringify the request url encoded params - if(request.headers['content-type'] = 'application/x-www-form-urlencoded') { + if(request.headers['content-type'] === 'application/x-www-form-urlencoded') { request.data = qs.stringify(request.data); } diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 734af95f..8e199772 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -126,7 +126,7 @@ const registerNetworkIpc = (mainWindow, watcher, lastOpenedCollections) => { interpolateVars(request, envVars, collectionVariables); // stringify the request url encoded params - if(request.headers['content-type'] = 'application/x-www-form-urlencoded') { + if(request.headers['content-type'] === 'application/x-www-form-urlencoded') { request.data = qs.stringify(request.data); }