mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
refactor(core): Create controller for binary data (no-changelog) (#7363)
This PR adds a controller for binary data + integration tests.
This commit is contained in:
@@ -6,7 +6,7 @@ import type { Request, Response } from 'express';
|
||||
import { parse, stringify } from 'flatted';
|
||||
import picocolors from 'picocolors';
|
||||
import { ErrorReporterProxy as ErrorReporter, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { Readable } from 'node:stream';
|
||||
import type {
|
||||
IExecutionDb,
|
||||
IExecutionFlatted,
|
||||
@@ -101,6 +101,11 @@ export function sendSuccessResponse(
|
||||
res.header(responseHeader);
|
||||
}
|
||||
|
||||
if (data instanceof Readable) {
|
||||
data.pipe(res);
|
||||
return;
|
||||
}
|
||||
|
||||
if (raw === true) {
|
||||
if (typeof data === 'string') {
|
||||
res.send(data);
|
||||
|
||||
Reference in New Issue
Block a user