mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix: allow empty header names in CLI and gRPC request preparation (#7925)
This commit is contained in:
@@ -30,7 +30,7 @@ const prepareRequest = async (item = {}, collection = {}) => {
|
||||
|
||||
const disabledHeaders = [];
|
||||
each(get(request, 'headers', []), (h) => {
|
||||
if (h.enabled && h.name.length > 0) {
|
||||
if (h.enabled && h.name?.length > 0) {
|
||||
headers[h.name] = h.value;
|
||||
if (h.name.toLowerCase() === 'content-type') {
|
||||
contentTypeDefined = true;
|
||||
|
||||
@@ -137,7 +137,7 @@ const prepareGrpcRequest = async (item, collection, environment, runtimeVariable
|
||||
}
|
||||
|
||||
each(get(request, 'headers', []), (h) => {
|
||||
if (h.enabled && h.name.length > 0) {
|
||||
if (h.enabled && h.name?.length > 0) {
|
||||
headers[h.name] = h.value;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -381,12 +381,12 @@ const prepareRequest = async (item, collection = {}, abortController) => {
|
||||
|
||||
const disabledHeaders = [];
|
||||
each(get(request, 'headers', []), (h) => {
|
||||
if (h.enabled && h.name.length > 0) {
|
||||
if (h.enabled && h.name?.length > 0) {
|
||||
headers[h.name] = h.value;
|
||||
if (h.name.toLowerCase() === 'content-type') {
|
||||
contentTypeDefined = true;
|
||||
}
|
||||
} else if (!h.enabled && h.name.length > 0) {
|
||||
} else if (!h.enabled && h.name?.length > 0) {
|
||||
disabledHeaders.push({ name: h.name, value: h.value });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user