From 1f266a5a7b3307a04d18950f33b90529aca21021 Mon Sep 17 00:00:00 2001 From: Eugene Molodkin Date: Wed, 25 Sep 2024 13:30:13 +0200 Subject: [PATCH 1/2] wip: do not send default user agent header with HTTP Tool node requests --- .../nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts index 421e85e1b5b8c..c92ebd95245ea 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts @@ -275,7 +275,10 @@ export class ToolHttpRequest implements INodeType { method: this.getNodeParameter('method', itemIndex, 'GET') as IHttpRequestMethods, url: this.getNodeParameter('url', itemIndex) as string, qs: {}, - headers: {}, + headers: { + // FIXME: This is a workaround to prevent the node from sending a default User-Agent (`n8n`) when the header is not set + 'User-Agent': undefined, + }, body: {}, }; From 2cb141e4ad4710dad08bec10a7f4bf406bb29b0c Mon Sep 17 00:00:00 2001 From: Eugene Molodkin Date: Thu, 26 Sep 2024 12:46:11 +0200 Subject: [PATCH 2/2] wip: add task ID to the comment --- .../nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts index c92ebd95245ea..32f6be42e74b6 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts @@ -276,7 +276,8 @@ export class ToolHttpRequest implements INodeType { url: this.getNodeParameter('url', itemIndex) as string, qs: {}, headers: { - // FIXME: This is a workaround to prevent the node from sending a default User-Agent (`n8n`) when the header is not set + // FIXME: This is a workaround to prevent the node from sending a default User-Agent (`n8n`) when the header is not set. + // Needs to be replaced with a proper fix after NODE-1777 is resolved 'User-Agent': undefined, }, body: {},