From 5e7e881cc3697804dee597cbe7f786eeb40b2c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 10 Jan 2024 17:13:52 +0100 Subject: [PATCH] fix(HTTP Request Node): Delete `response.request` only when it's a valid circular references Fixes NODE-1037 --- packages/nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts | 2 +- packages/nodes-base/nodes/HttpRequest/V2/HttpRequestV2.node.ts | 2 +- packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts b/packages/nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts index 46b3fe61c9e9c..6bf4e0a98fdb3 100644 --- a/packages/nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts +++ b/packages/nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts @@ -994,7 +994,7 @@ export class HttpRequestV1 implements INodeType { } response = response.value; - delete response.request; + if (response?.request?.constructor.name === 'ClientRequest') delete response.request; const options = this.getNodeParameter('options', itemIndex, {}); diff --git a/packages/nodes-base/nodes/HttpRequest/V2/HttpRequestV2.node.ts b/packages/nodes-base/nodes/HttpRequest/V2/HttpRequestV2.node.ts index 82941b01db53b..2c5d78f206ea5 100644 --- a/packages/nodes-base/nodes/HttpRequest/V2/HttpRequestV2.node.ts +++ b/packages/nodes-base/nodes/HttpRequest/V2/HttpRequestV2.node.ts @@ -1047,7 +1047,7 @@ export class HttpRequestV2 implements INodeType { } response = response.value; - delete response.request; + if (response?.request?.constructor.name === 'ClientRequest') delete response.request; const options = this.getNodeParameter('options', itemIndex, {}); diff --git a/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts b/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts index 0f60254037bd1..c6fabfa41e746 100644 --- a/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts +++ b/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts @@ -1786,7 +1786,8 @@ export class HttpRequestV3 implements INodeType { // eslint-disable-next-line prefer-const for (let [index, response] of Object.entries(responses)) { - delete response.request; + if (response?.request?.constructor.name === 'ClientRequest') delete response.request; + if (this.getMode() === 'manual' && index === '0') { // For manual executions save the first response in the context // so that we can use it in the frontend and so make it easier for