mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
🐛 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:
@@ -1,10 +1,9 @@
|
||||
import {
|
||||
BINARY_ENCODING,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IN8nHttpFullResponse,
|
||||
IN8nHttpResponse,
|
||||
INodeExecutionData,
|
||||
@@ -202,7 +201,7 @@ export class RespondToWebhook implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
|
||||
const respondWith = this.getNodeParameter('respondWith', 0) as string;
|
||||
@@ -250,6 +249,7 @@ export class RespondToWebhook implements INodeType {
|
||||
}
|
||||
|
||||
const binaryData = item.binary[responseBinaryPropertyName];
|
||||
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(0, responseBinaryPropertyName);
|
||||
|
||||
if (binaryData === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${responseBinaryPropertyName}" does not exists on item!`);
|
||||
@@ -258,7 +258,7 @@ export class RespondToWebhook implements INodeType {
|
||||
if (headers['content-type']) {
|
||||
headers['content-type'] = binaryData.mimeType;
|
||||
}
|
||||
responseBody = Buffer.from(binaryData.data, BINARY_ENCODING);
|
||||
responseBody = binaryDataBuffer;
|
||||
} else if (respondWith !== 'noData') {
|
||||
throw new NodeOperationError(this.getNode(), `The Response Data option "${respondWith}" is not supported!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user