🐛 Binary data handling fixes (#2629)

* Update node airtable

* Update nodenextcloud

* Update node spreadsheet

* Update node cortex, dropbox, editImage nodes

* Update node emailSend

* Update node ftp

* Update node googleDrive

* Update node googleDrive fix

* Update node youtube

* Update node htmlExtract

* Update node linkedIn

* Update node mailgun

* Update node matrix

* Update node pipedrive

* Update node readPdf

* Update node facebookGraphApi

* Update node httpRequest

* Update node nocoDB

* Update node httpRequest, respondToWebhook

* Update node signi4

* Update node slack

* Update node zulip

* cleanup

* fix generic funcs

* 🐛 Fix EditImage Node

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ahsan Virani
2022-01-03 22:42:42 +01:00
committed by GitHub
parent aff93480d4
commit 224ef736de
27 changed files with 66 additions and 117 deletions

View File

@@ -1,5 +1,4 @@
import {
BINARY_ENCODING,
IExecuteFunctions,
} from 'n8n-core';
import {
@@ -771,8 +770,9 @@ export class HttpRequest implements INodeType {
if (item.binary[binaryPropertyName] === undefined) {
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`);
}
const binaryProperty = item.binary[binaryPropertyName] as IBinaryData;
requestOptions.body = Buffer.from(binaryProperty.data, BINARY_ENCODING);
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
requestOptions.body = binaryDataBuffer;
} else if (options.bodyContentType === 'multipart-form-data') {
requestOptions.body = {};
const binaryPropertyNameFull = this.getNodeParameter('binaryPropertyName', itemIndex) as string;
@@ -794,9 +794,10 @@ export class HttpRequest implements INodeType {
}
const binaryProperty = item.binary[binaryPropertyName] as IBinaryData;
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
requestOptions.body[propertyName] = {
value: Buffer.from(binaryProperty.data, BINARY_ENCODING),
value: binaryDataBuffer,
options: {
filename: binaryProperty.fileName,
contentType: binaryProperty.mimeType,