From 4b1bcc17a231e5d4752413f2b33a60a27c8b8554 Mon Sep 17 00:00:00 2001 From: ricardo Date: Fri, 12 Nov 2021 10:43:39 -0500 Subject: [PATCH] :bug: Fixes issue that set content-type when downloading a file --- packages/nodes-base/nodes/HttpRequest.node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/HttpRequest.node.ts b/packages/nodes-base/nodes/HttpRequest.node.ts index 6048595d2f..57db60f51b 100644 --- a/packages/nodes-base/nodes/HttpRequest.node.ts +++ b/packages/nodes-base/nodes/HttpRequest.node.ts @@ -864,7 +864,9 @@ export class HttpRequest implements INodeType { if (requestOptions.headers === undefined) { requestOptions.headers = {}; } - requestOptions.headers['Content-Type'] = 'application/json'; + if (['POST', 'PUT', 'PATCH'].includes(requestMethod)) { + requestOptions.headers['Content-Type'] = 'application/json'; + } } } else if (options.bodyContentType === 'raw') { requestOptions.json = false; @@ -918,7 +920,7 @@ export class HttpRequest implements INodeType { }; } this.sendMessageToUI(sendRequest); - } catch (e) {} + } catch (e) { } // Now that the options are all set make the actual http request if (oAuth1Api !== undefined) {