From 3ddd671c4797482a396844e804b4b45b82dbff2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Tue, 14 Nov 2023 14:55:55 +0100 Subject: [PATCH] fix(api-gateway): remove the verify body function --- packages/api-gateway/bin/server.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/api-gateway/bin/server.ts b/packages/api-gateway/bin/server.ts index 1ed26723f..cd35ff7ec 100644 --- a/packages/api-gateway/bin/server.ts +++ b/packages/api-gateway/bin/server.ts @@ -73,20 +73,7 @@ void container.load().then((container) => { }), ) - app.use( - json({ - limit: '50mb', - verify: (_req: IncomingMessage, _res: ServerResponse, buf: Buffer, encoding: string): void => { - try { - if (buf && buf.length > 0) { - JSON.parse(buf.toString(encoding as BufferEncoding | 'utf8')) - } - } catch (error) { - logger.error(`Invalid JSON: ${(error as Error).message}. Request body: ${buf.toString()}`) - } - }, - }), - ) + app.use(json({ limit: '50mb' })) app.use( text({ type: ['text/plain', 'application/x-www-form-urlencoded', 'application/x-www-form-urlencoded; charset=utf-8'],