mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-27 06:34:06 +00:00
fix: Ignore empty header on Auth API Key(Header) to prevent sending request error (#5007)
This commit is contained in:
@@ -61,6 +61,7 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
break;
|
||||
case 'apikey':
|
||||
const apiKeyAuth = get(collectionAuth, 'apikey');
|
||||
if (apiKeyAuth.key.length === 0) break;
|
||||
if (apiKeyAuth.placement === 'header') {
|
||||
axiosRequest.headers[apiKeyAuth.key] = apiKeyAuth.value;
|
||||
} else if (apiKeyAuth.placement === 'queryparams') {
|
||||
@@ -277,6 +278,7 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
break;
|
||||
case 'apikey':
|
||||
const apiKeyAuth = get(request, 'auth.apikey');
|
||||
if (apiKeyAuth.key.length === 0) break;
|
||||
if (apiKeyAuth.placement === 'header') {
|
||||
axiosRequest.headers[apiKeyAuth.key] = apiKeyAuth.value;
|
||||
} else if (apiKeyAuth.placement === 'queryparams') {
|
||||
|
||||
Reference in New Issue
Block a user