From 5ce5070e21c06ce959c0cfa8635ccb7b182b6b5c Mon Sep 17 00:00:00 2001 From: Lucas Matwiejczuk Date: Mon, 5 Oct 2026 23:17:20 -0300 Subject: [PATCH] fix(project): increase remote image download limit to 30MB for legacy assets migration --- src/module/project/project.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/module/project/project.service.ts b/src/module/project/project.service.ts index ed38014..12b5122 100644 --- a/src/module/project/project.service.ts +++ b/src/module/project/project.service.ts @@ -217,11 +217,11 @@ export class ProjectService { } /** - * Downloads an image from an external HTTP/HTTPS URL with timeout and size cap (10MB). + * Downloads an image from an external HTTP/HTTPS URL with timeout and size cap (30MB). */ async fetchImageBuffer( url: string, - timeoutMs = 8000, + timeoutMs = 20000, ): Promise<{ buffer: Buffer; mimetype: string }> { return new Promise((resolve, reject) => { const client = url.startsWith('https') ? https : http; @@ -258,12 +258,12 @@ export class ProjectService { const contentType = res.headers['content-type'] || 'image/jpeg'; const chunks: Buffer[] = []; let totalLength = 0; - const maxBytes = 10 * 1024 * 1024; // 10MB limit + const maxBytes = 30 * 1024 * 1024; // 30MB limit res.on('data', (chunk: Buffer) => { totalLength += chunk.length; if (totalLength > maxBytes) { - req.destroy(new Error('Image exceeds 10MB size limit')); + req.destroy(new Error('Image exceeds 30MB size limit')); return; } chunks.push(chunk);