mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(HTTP Request Node): Respect the original encoding of the incoming response (#9869)
This commit is contained in:
committed by
GitHub
parent
e84ab35c4a
commit
2d19aef540
@@ -3,7 +3,7 @@ import prettyBytes from 'pretty-bytes';
|
||||
import Container, { Service } from 'typedi';
|
||||
import { BINARY_ENCODING } from 'n8n-workflow';
|
||||
import { InvalidModeError } from '../errors/invalid-mode.error';
|
||||
import { areConfigModes, toBuffer } from './utils';
|
||||
import { areConfigModes, binaryToBuffer } from './utils';
|
||||
|
||||
import type { Readable } from 'stream';
|
||||
import type { BinaryData } from './types';
|
||||
@@ -84,7 +84,7 @@ export class BinaryDataService {
|
||||
const manager = this.managers[this.mode];
|
||||
|
||||
if (!manager) {
|
||||
const buffer = await this.toBuffer(bufferOrStream);
|
||||
const buffer = await binaryToBuffer(bufferOrStream);
|
||||
binaryData.data = buffer.toString(BINARY_ENCODING);
|
||||
binaryData.fileSize = prettyBytes(buffer.length);
|
||||
|
||||
@@ -110,10 +110,6 @@ export class BinaryDataService {
|
||||
return binaryData;
|
||||
}
|
||||
|
||||
async toBuffer(bufferOrStream: Buffer | Readable) {
|
||||
return await toBuffer(bufferOrStream);
|
||||
}
|
||||
|
||||
async getAsStream(binaryDataId: string, chunkSize?: number) {
|
||||
const [mode, fileId] = binaryDataId.split(':');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user