fix(HTTP Request Node): Respect the original encoding of the incoming response (#9869)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-07-11 17:03:52 +02:00
committed by GitHub
parent e84ab35c4a
commit 2d19aef540
9 changed files with 152 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
import fs from 'node:fs/promises';
import { Service } from 'typedi';
import { v4 as uuid } from 'uuid';
import { toBuffer } from './utils';
import { binaryToBuffer } from './utils';
import { ObjectStoreService } from '../ObjectStore/ObjectStore.service.ee';
import type { Readable } from 'node:stream';
@@ -22,7 +22,7 @@ export class ObjectStoreManager implements BinaryData.Manager {
metadata: BinaryData.PreWriteMetadata,
) {
const fileId = this.toFileId(workflowId, executionId);
const buffer = await this.toBuffer(bufferOrStream);
const buffer = await binaryToBuffer(bufferOrStream);
await this.objectStoreService.put(fileId, buffer, metadata);
@@ -100,8 +100,4 @@ export class ObjectStoreManager implements BinaryData.Manager {
return `workflows/${workflowId}/executions/${executionId}/binary_data/${uuid()}`;
}
private async toBuffer(bufferOrStream: Buffer | Readable) {
return await toBuffer(bufferOrStream);
}
}