Ignore empty headers (#1917)

Co-authored-by: Antonin Huaut <antonin.huaut@dejamobile.com>
This commit is contained in:
Antonin Huaut 2024-04-09 23:19:16 +02:00 committed by GitHub
parent 9ee6f9a8cc
commit 1f786871b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;