mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: HTTP Request tool - do not error on missing headers (#10044)
This commit is contained in:
@@ -49,7 +49,8 @@ const genericCredentialRequest = async (ctx: IExecuteFunctions, itemIndex: numbe
|
||||
const headerAuth = await ctx.getCredentials('httpHeaderAuth', itemIndex);
|
||||
|
||||
return async (options: IHttpRequestOptions) => {
|
||||
options.headers![headerAuth.name as string] = headerAuth.value;
|
||||
if (!options.headers) options.headers = {};
|
||||
options.headers[headerAuth.name as string] = headerAuth.value;
|
||||
return await ctx.helpers.httpRequest(options);
|
||||
};
|
||||
}
|
||||
@@ -58,9 +59,7 @@ const genericCredentialRequest = async (ctx: IExecuteFunctions, itemIndex: numbe
|
||||
const queryAuth = await ctx.getCredentials('httpQueryAuth', itemIndex);
|
||||
|
||||
return async (options: IHttpRequestOptions) => {
|
||||
if (!options.qs) {
|
||||
options.qs = {};
|
||||
}
|
||||
if (!options.qs) options.qs = {};
|
||||
options.qs[queryAuth.name as string] = queryAuth.value;
|
||||
return await ctx.helpers.httpRequest(options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user