From 1f786871b86cd3064722dfc404d855f40d4e5208 Mon Sep 17 00:00:00 2001 From: Antonin Huaut Date: Tue, 9 Apr 2024 23:19:16 +0200 Subject: [PATCH] Ignore empty headers (#1917) Co-authored-by: Antonin Huaut --- packages/bruno-electron/src/ipc/network/prepare-request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-electron/src/ipc/network/prepare-request.js b/packages/bruno-electron/src/ipc/network/prepare-request.js index 3013ab439..f1c090e4d 100644 --- a/packages/bruno-electron/src/ipc/network/prepare-request.js +++ b/packages/bruno-electron/src/ipc/network/prepare-request.js @@ -148,7 +148,7 @@ const prepareRequest = (request, collectionRoot, collectionPath) => { // collection headers each(get(collectionRoot, 'request.headers', []), (h) => { - if (h.enabled) { + if (h.enabled && h.name.length > 0) { headers[h.name] = h.value; if (h.name.toLowerCase() === 'content-type') { contentTypeDefined = true; @@ -157,7 +157,7 @@ const prepareRequest = (request, collectionRoot, collectionPath) => { }); each(request.headers, (h) => { - if (h.enabled) { + if (h.enabled && h.name.length > 0) { headers[h.name] = h.value; if (h.name.toLowerCase() === 'content-type') { contentTypeDefined = true;