mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
⚡ Use constant for encoding
This commit is contained in:
parent
8d8b9c9652
commit
122a0c79a3
|
@ -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,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue