mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Use constant for encoding
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
BINARY_ENCODING,
|
||||||
IWebhookFunctions,
|
IWebhookFunctions,
|
||||||
} from 'n8n-core';
|
} from 'n8n-core';
|
||||||
|
|
||||||
@@ -330,7 +331,7 @@ export class Webhook implements INodeType {
|
|||||||
const fileContent = await fs.promises.readFile(files[file].path);
|
const fileContent = await fs.promises.readFile(files[file].path);
|
||||||
const buffer = Buffer.from(fileContent);
|
const buffer = Buffer.from(fileContent);
|
||||||
set(returnData[0], `binary[${fileName}]`, {
|
set(returnData[0], `binary[${fileName}]`, {
|
||||||
data: buffer.toString('base64'),
|
data: buffer.toString(BINARY_ENCODING),
|
||||||
mimeType: fileJson.type,
|
mimeType: fileJson.type,
|
||||||
fileName: fileJson.name,
|
fileName: fileJson.name,
|
||||||
fileExtension,
|
fileExtension,
|
||||||
@@ -357,7 +358,7 @@ export class Webhook implements INodeType {
|
|||||||
response.binary = {
|
response.binary = {
|
||||||
data: {
|
data: {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data: req.rawBody.toString('base64'),
|
data: req.rawBody.toString(BINARY_ENCODING),
|
||||||
mimeType,
|
mimeType,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user