mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
⚡ Use constant for encoding
This commit is contained in:
parent
8d8b9c9652
commit
122a0c79a3
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
BINARY_ENCODING,
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
|
@ -330,7 +331,7 @@ export class Webhook implements INodeType {
|
|||
const fileContent = await fs.promises.readFile(files[file].path);
|
||||
const buffer = Buffer.from(fileContent);
|
||||
set(returnData[0], `binary[${fileName}]`, {
|
||||
data: buffer.toString('base64'),
|
||||
data: buffer.toString(BINARY_ENCODING),
|
||||
mimeType: fileJson.type,
|
||||
fileName: fileJson.name,
|
||||
fileExtension,
|
||||
|
@ -357,7 +358,7 @@ export class Webhook implements INodeType {
|
|||
response.binary = {
|
||||
data: {
|
||||
// @ts-ignore
|
||||
data: req.rawBody.toString('base64'),
|
||||
data: req.rawBody.toString(BINARY_ENCODING),
|
||||
mimeType,
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue