From ef00dbd90281b9b9f67efe20be0cc0bed36b125e Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Wed, 29 May 2024 17:20:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20remove=20fastify=20multipart=20f?= =?UTF-8?q?ileSize=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node/src/core/platform/services/webserver/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tdrive/backend/node/src/core/platform/services/webserver/index.ts b/tdrive/backend/node/src/core/platform/services/webserver/index.ts index f3b6ebe25..80307ab6a 100644 --- a/tdrive/backend/node/src/core/platform/services/webserver/index.ts +++ b/tdrive/backend/node/src/core/platform/services/webserver/index.ts @@ -108,7 +108,13 @@ export default class WebServerService extends TdriveService implem this.server.register(sensible, { errorHandler: false, } as FastifyRegisterOptions); - this.server.register(multipart); + this.server.register(multipart, { + throwFileSizeLimit: true, + limits: { + // note that null, undefined, 0 and -1 do not remove the default 1mg limit + fileSize: 500 * 1024 * 1024 * 1024 * 1024, + }, + }); this.server.register(formbody); this.server.register(corsPlugin, this.configuration.get("cors", {}));